MATLAB Function Reference | Search  Help Desk |
speye | Examples See Also |
S = speye(m,
n)
S = speye(n)
S = speye(m,n)
forms an m
-by-n
sparse matrix with 1
s on the main diagonal.
S = speye(n)
abbreviates speye(n,n)
.
I
=
speye(1000)
forms the sparse representation of the 1000-by-1000 identity matrix, which requires only about 16 kilobytes of storage. This is the same final result as I
=
sparse(eye(1000,1000))
, but the latter requires eight megabytes for temporary storage for the full representation.
spalloc
Allocate space for sparse matrix
spones
Replace nonzero sparse matrix elements with ones
spdiags
Extract and create sparse band and diagonal matrices
sprand
Sparse uniformly distributed random matrix
sprandn
Sparse normally distributed random matrix