cannot read/write sparse matrices to matlab v4
David Bateman
David.Bateman at motorola.com
Tue Jul 8 03:29:58 CDT 2008
Daniel Heiserer wrote:
> Hi,
>
> the read and write of sparse matrices to v4 matlab does not work:
>
> octave:5> tic;load C4.mat;toc
> error: load: can't read sparse matrices
>
>
> When writing is tried, it seems octave will internally create a full matrix before writing it to the v4 file. This will explode once the matrix is too large:
>
>
> N=1E7;C=sparse(ceil(N*rand(N,1)),ceil(N*rand(N,1)),rand(N,1),N,N);
> save -v4 C4.mat C
>
>
> octave version was:
>
> octave:5> version
> ans = 3.0.0
>
>
>
Huh, I never even realized that matlab could save a sparse matrix to a
v4 file format! The documentation has a flag for the sparse file format
but then doesn't document how the nnz, cidx, ridx and data parts of the
Sparse matrix are stored. So I presumed that as documented they were
saved as full matrices in v4 format. Without knowledge of the v4 sparse
format I'm not really sure how to implement this..
D.
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
More information about the Bug-octave
mailing list