function ShowSparse3()
% Illustrates basic linear algebra between sparse matrices.


% A random 20000x10000 matrix where the probability that an
% entry is nonzero is .001.
m = 20000;
n = 10000;
A = sprandn(m,n,.001);
spy(A)
shg
pause(3)
% Another big matrix...
p = 3000;
B = sprandn(n,p,.0001);
% A product..
C = A*B;
% C will be in sparse format...
spy(C)
title(sprintf('C = AB  Percent nonzero = %7.3f',nnz(C)/(m*p)),'fontsize',18)
shg
pause
x = randn(n,1);
% Sparsity is exploited in this product. Note that x is in full format.
y = A*x;