Given column vectors I, J, and V, one can construct a sparse matrix using
the following syntax:
sparse(I, J, V)
How about the reverse? I.e., given a sparse matrix S, is there a function
which returns the column vectors I, J, and V that define S?
One can obtain the list of nonzero values V
Try findnz.
This seems to not be documented in the sparse section of the manual, but I
would think it should be.
— John
On Sep 18, 2014, at 6:58 PM, DumpsterDoofus peter.richter@gmail.com wrote:
Given column vectors I, J, and V, one can construct a sparse matrix using the
following
Thanks, that's what I was looking for! I forked a copy of the
documentation on my GitHub account and added in the following entry to the
sparse matrix section:
.. function:: findnz(A)
Returns a tuple (I, J, V) containing the column indices, row indices, and
nonzero values. The I, J,
Submit a pull request?
One point: I think you may have flipped column indices and row indices in your
description.
— John
On Sep 18, 2014, at 7:45 PM, DumpsterDoofus peter.richter@gmail.com wrote:
Thanks, that's what I was looking for! I forked a copy of the documentation
on my GitHub