Convert Full to Sparse
You can convert a full matrix to a sparse storage using a sparse function with a single argument.
S = sparse(A)
for instance
A = [ 0 0 0 5
0 2 0 0
1 3 0 0
0 0 4 0];
S = sparse(A)
produces
S =
(3,1) 1
(2,2) 2
(3,2) 3
(4,3) 4
(1,4) 5
S . , .
, , . , A = full (S) .
- . , , .