sparse
sparse
(u)=sparse(A)
Inputs
A A matrix.
Outputs
u The sparse matrix constructed from the input A .


Example
>>a=fix(randn(5,5)*200)
>>a
       -137         78       -280       -108       -321
       -222        290         70        -27        -42
          2        198         90       -272        124
        360       -183       -231       -245       -177
          0       -112       -383       -101       -284

>>a[find(a<0)]=0
>>a
          0         78          0          0          0
          0        290         70          0          0
          2        198         90          0        124
        360          0          0          0          0
          0          0          0          0          0

>>sparse(a)
Scaled by 10^1
        ( 3, 1)    0.2000
        ( 4, 1)   36.0000
        ( 1, 2)    7.8000
        ( 2, 2)   29.0000
        ( 3, 2)   19.8000
        ( 2, 3)    7.0000
        ( 3, 3)    9.0000
        ( 3, 5)   12.4000