octave-maintainers
[Top][All Lists]
Advanced

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

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


From: Søren Hauberg
Subject: Re: type of sort(sparse(...))
Date: Sun, 02 Sep 2007 10:26:13 +0200
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

David Bateman skrev:
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..
>> [a, i] = sort (sprand (10,10,0.2));
>> whos
  Name       Size            Bytes  Class     Attributes

  a         10x10              284  double    sparse
  i         10x10              800  double

Søren


reply via email to

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