octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: type of sort(sparse(...))


From: David Bateman
Subject: Re: type of sort(sparse(...))
Date: Sun, 02 Sep 2007 08:34:13 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

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

D.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]