Why do I receive an an "out of memory" error when I resize a sparse matrix in a MEX file in MATLAB?
1 view (last 30 days)
Show older comments
Why do I receive an "out of memory" error when I resize a sparse matrix in a MEX-file in MATLAB?
I wrote a MEX-file that handles sparse matrices correctly. When the DLL returns the output data to the MATLAB workspace, the matrix is correct. I use the FIND function on this output matrix and can read out columns and rows. However, if the matrix contains less non-zero values, I get an OUT OF MEMORY error.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
The problem appears to occur when you incorrectly size the JC field of a sparse matrix. This field must be size N+1, where N is the length of the number of columns of the sparse matrix.
0 Comments
More Answers (0)
See Also
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!