  function P1()
% Sparse Least Squares 
% 
% Set up the matrix using sprandn...
m = 1000;       % The number of rows
n = 40;        % The number of columns
density = .1;  % There will be approximately density*m*n nonzeros
rc = .000001;  % reciprocal of condition number;
A = sprandn(m,n,density,rc) ;
b = randn(m,1);
xLS = OutOfCoreLS(A,b);
% Solution via backslash... 
xMatlab = A\b;
% Look at discrepancy...
errxLS = norm(xLS - xMatlab)/norm(xMatlab)
% This is not the error because Matlab uses a similar method



