From: Amit on
how can I store a matrix having short integers as sparse matrix.
I used following code but it did not work-

b=zeros(10,10);
b(2,:)=[1,2,3,4,5,6,7,8,9,10];
c=uint16(b);
d=sparse(c);

Please somebody help me. I need to store a very big matrix.

Thanks,
Amit
From: James Tursa on
"Amit " <amitsingh.singh(a)gmail.comp> wrote in message <i037et$s03$1(a)fred.mathworks.com>...
> how can I store a matrix having short integers as sparse matrix.
> I used following code but it did not work-
>
> b=zeros(10,10);
> b(2,:)=[1,2,3,4,5,6,7,8,9,10];
> c=uint16(b);
> d=sparse(c);
>
> Please somebody help me. I need to store a very big matrix.

MATLAB does not support sparse matrices for any type other than double.

James Tursa
From: Matt J on
"James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <i03b0l$e53$1(a)fred.mathworks.com>...

> MATLAB does not support sparse matrices for any type other than double.

double and logical, you mean. But I guess that won't help.