Søren Hauberg wrote:
David Bateman skrev:
Could someone who has a recent copy of matlab tell me what
a = sort (sprand(10,10,0.2));
whos a
gives? In Octave this converts the sparse matrix to a full one, whereas
I suspect in matlab it might not.
Matlab Version 7.4.0.129 (R2007a):
a = sort (sprand(10,10,0.2));
whos a
Name Size Bytes Class Attributes
a 10x10 248 double sparse
Now that I think about it, what does
[a, i] = sort (sprand (10,10,0.2))
whos i
give.. For good measure note I ask what the values of a and i are.. My
worry here is that as a is sparse above, I don't see how i can be and so
it makes no sense to do an indexed sort of a sparse matrix..