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.