From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sparse matrix indexing speed -- shape sensitivity
Date: Mon, 29 Aug 2011 14:56:09 +0000 (UTC)
Organization: Boeing Co
Lines: 15
Message-ID: <j3g9a9$rf1$>
References: <j3bumn$9ts$> <j3cqer$o66$> <j3df6i$jnq$> <j3dftj$lkh$> <j3dk7r$3mp$> <j3dtcs$rjq$> <j3efp3$h5h$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1314629769 28129 (29 Aug 2011 14:56:09 GMT)
NNTP-Posting-Date: Mon, 29 Aug 2011 14:56:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: comp.soft-sys.matlab:741594

"Matt J" wrote in message <j3efp3$h5h$>...
> MATLAB already has limitations similar to this presently on its 2D sparse matrices which user's must work around. Why should it be that this all-zero matrix stores perfectly fine
>  A=sparse(1e8,1);
> but not its transpose,
> >> A.';
> ??? Error using ==> transpose
> Out of memory. Type HELP MEMORY for your options.

Because for every sparse matrix, even an empty one, MATLAB allocates memory to hold an index array the size of (number of columns + 1). There will be a bunch of 0's in this index array for an empty matrix, but the memory still gets allocated.

James Tursa