Reputation: 21254
I have a large sparse matrix M
. How can I find the index of a column in the matrix which has only one value set? That is exactly one non-zero value.
Upvotes: 1
Views: 92
Reputation: 2838
I think findall(==(1), diff(M.colptr))
should do it (to find all columns with one stored value).
Upvotes: 3