Construct Sparse Matrix in Matlab from Compressed Sparse Column (CSC) format
user43833 Published in September 20, 2018, 10:22 pm
I have a large sparse matrix (~5 billion non-zero values) in Python, stored in the csc_matrix format. I need to open it as a sparse matrix in Matlab. savemat apparently cannot save data of this size (seems to be capped at ~5GB), so I am resorting to saving it as an hdf5 file, as detailed here. However, I am having trouble opening it in matlab.
Given these three vectors: data, indices, indptr, whose meaning is explained:
standard CSC representation where the row indices for column i
are stored in indices[indptr[i]:indptr[i+1]] and their corresponding
values are stored in data[indptr[i]:indptr[i+1]].
How can I construct this matrix in Matlab? I can open these three vectors in Matlab using h5read no problem, but I don't know how to use them to construct the sparse matrix. This is not the format of the sparse command I usually use to construct a sparse matrix.
python matlab numpy matrix scipy
share|improve this question
edited May 23 '17 at 12:25
asked Mar 25 '17 at 21:00
Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.
Browse other questions tagged python matlab numpy matrix scipy or ask your own question.