I am using MATLAB to load a text file that I want to make a sparse matrix out of. The columns in the text file refer to the row indices and are double
type. I need them to be integers to be able to use them as indices for rows and columns. I tried using uint8
, int32
and int64
to convert them to integers to use them to build a sparse matrix as so:
??? Undefined function or method 'sparse' for input arguments of type 'int64'. Error in ==> make_network at 5
graph =sparse(int64(listedges(:,1)),int64(listedges(:,2)),ones(size(listedges,1),1));
How can I convert the text file entries loaded as double so as to be used by the sparse
function?