How intelligently does Matlab deal with sparse matrix operations?
Show older comments
I am curious about how Matlab deals with sparse matrices:
Knowing that all of the matrices I am operating on are defined as (or built as) sparse matrices throughout my code (e.g., A = spalloc(n,n,nzmax), and then elements are added to A), can I be sure that Matlab is dealing with them intelligently when I loop through the elements in a row and perform arithmetic operations? Meaning, do I need to do anything in particular to ensure that Matlab only deals with the nonzero elements in a sparse matrix, or will the "sparse" designation handle that for me under the hood?
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!