Dear all, I am using octave2.9.9 CVS when I ru the following program n = 500; density = 0.1; knum=0.5;
for i=1:5 density = density*0.5; X = sprandsym(n,density); y = randn(n,1); tic; b = X\y; time1 = toc; xf = full(X); tic; b = xf\y; time2 = toc; fprintf('# of non-zero elements in X = %6d \n',nnz(X)); fprintf('sparse matrix solution time = %8.3f \n',time1); fprintf('full matrix solution time = %8.3f \n',time2); endfor
I obtain
error: number of rows must match (251 != 250) near line 69, column 47 error: evaluating assignment _expression_ near line 68, column 9 error: evaluating if command near line 64, column 5 error: evaluating if command near line 36, column 3 error: called from `sprandsym' in file
`/usr/share/octave/2.9.9+/m/sparse/sprandsym.m' error: evaluating assignment _expression_ near line 6, column 4 error: evaluating for command near line 4, column 1 error: near line 14 of file `example22.m'