Section: Sparse Matrix Support
y = speye(m,n)
which forms an m x n
sparse matrix with ones on the main diagonal,
or
y = speye(n)
which forms an n x n
sparse matrix with ones on the main diagonal. The
matrix type is a float
single precision matrix.
sparse(eye(5000))
because of the large amount
of intermediate storage required.
--> I = speye(5000) I = Matrix is sparse with 5000 nonzeros --> full(I(1:10,1:10)) ans = 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 --> quit