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.
Best Answer