This function is very helpful for authors of mexFunctions that return sparse matrices to MATLAB. It is of no use at all to those who work purely with M-files (if you do not write C mexFunctions, please don't bother downloading or rating this file).
A MATLAB sparse matrix is stored in a compressed-column form that can be difficult to generate in a C or Fortran mexFunction. This function, spok, will determine if your matrix is valid. You can also call the C spok function from inside your mexFunction.
Tim Davis (2020). spok: checks if a MATLAB sparse matrix is OK (https://www.mathworks.com/matlabcentral/fileexchange/20186-spok-checks-if-a-matlab-sparse-matrix-is-ok), MATLAB Central File Exchange. Retrieved .
Very good work. This helped me solve a problem in my own code that I would not have found without it.
Thank you so much!
Great work. The option '-largeArrayDims' can be added to the mex commands in spok_install.m and spok_test.m to avoid errors such as 'LINK : fatal error LNK1181: cannot open input file "kernel32.lib"' and 'Function "mxGetJc_700" is obsolete.
(64-bit mex files using sparse matrices must be rebuilt with the "-largeArrayDims" option. See the
R2006b release notes for more details.).'
Great work. But the submmited file is in c. I want to know if a MATLAB sparse matrix is passed into a FORTRAN mex file how to indexing it?
Converted to a toolbox. Updated so that it works in a 64-bit MATLAB.
Removed POSIX standard function "snprintf" which Microsoft doesn't comprehend. Should now work on Windows.