Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Convert array of class 'int8' to sparse
Date: Thu, 13 Nov 2008 15:30:20 +0000 (UTC)
Organization: Provision Communications Technologies Ltd
Lines: 7
Message-ID: <gfhh6c$dvr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226590220 14331 172.30.248.38 (13 Nov 2008 15:30:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Nov 2008 15:30:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1016247
Xref: news.mathworks.com comp.soft-sys.matlab:500637


Hi,
Am new to sparse matrices and hoping someone can help me with this. I have a large (150MB) binary file of 'int8' type data which I am loading into an array A. The data has a large number of 0's, so I would like to hold it in a sparse matrix. However, if I type the command B=sparse(A), I get the error message: "??? Undefined function or method 'sparse' for input arguments of type 'int8'". I have read through the documentation on sparse matrices and can't see anywhere where it says one can only convert matrices of type 'double' to sparse (unless I missed it). In any case, is there any reason why it would not be possible to convert integer type arrays to sparse? Or am I doing something wrong?

Thanks in advance for any suggestions.

Bobane