help-octave
[Top][All Lists]
Advanced

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

Re: generating sparse matricies


From: Søren Hauberg
Subject: Re: generating sparse matricies
Date: Sat, 01 Oct 2005 09:27:15 +0200

I can't remember if this works in 2.164, but in 2.9.3 you can just use
'sprand'

/Søren

fre, 30 09 2005 kl. 23:07 -0700, skrev Paul Roberts:
> Hello,
> 
> I am using Octave 2.1.64. I would like to iteratively build a sparse
> matrix uring code like:
> 
> X = sparse(10000,1000);
> for j=1:1000
> X(:, j) = rand(10000,1) < 0.01;
> end
> 
> I have found however that when I try X(:,j) = rand(10000,1) < 0.01;,
> the matrix X is converted to a full matrix. This happens even if I
> write: X(:,j) = sparse(rand(10000,1) < 0.01); 
> 
> My questions are: (1) Will this be changed in future versions of
> Octave and (2) is there an efficient work around for this issue? I
> have tried using sphcat, but that seems to be very slow.
> 
> Thanks!
> 
> Paul
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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