[Top][All Lists]

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

generating sparse matricies

From: Paul Roberts
Subject: generating sparse matricies
Date: Fri, 30 Sep 2005 23:07:31 -0700


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;

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.



reply via email to

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