[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sparse part2

From: Andy Adler
Subject: Re: Sparse part2
Date: Tue, 25 May 2004 14:49:16 -0400 (EDT)

On Mon, 24 May 2004, Andre Viljoen wrote:

> Anyway, I have installed the sparse arrays from /main/sparse manually
> and it works. I can create sparse matrices by "A = sparse(20,20);" for
> example. Now I try to load a variable from MATLAB h.mat by "load h.mat"
> and the compiler still spits at me that sparse matrices are not
> supported.
> This is bad.
> Any ideas? :)

Yes. Matlab defines the storage of its sparse matrix
types here:
(starting at page 20).

You should be able to implement code to read the file with
fopen and fread, and then create a sparse matrix with
S = sparse(i,j,s,m,n)  where
        i,j   are integer index vectors (1 x nnz)
        s     is the vector of real or complex entries (1 x nnz)
        m,n   are the scalar dimentions of S

A further improvement would be to add a method
octave_sparse::load_binary( ) to the files and


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]