sprand - sparse random matrix
sp=sprand(nrows,ncols,fill) returns a sparse matrix sp with nrows rows, ncols columns and approximately fill*nrows*ncols non-zero entries.
If typ='uniform' uniformly distributed values on [0,1] are generated. If typ='normal' normally distributed values are generated (mean=0 and standard deviation=1).
W=sprand(100,1000,0.001);