help-octave
[Top][All Lists]
Advanced

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

Re: ASCII file format for sparse matrices?


From: Rik
Subject: Re: ASCII file format for sparse matrices?
Date: Tue, 24 May 2011 11:00:12 -0700

Rui,

Yes, in fact there is a very simple format.  Check the function
spconvert().  Basically, all you need is a file with a 3-column format of
ROW, COL, VALUE.  This is easier than trying to hack Octave's
compressed-column format.  Note, it relies on Octave's load command which
works on ordinary text files to first create a full array with the data
from the file and then converts that.

Sample File
2 1 0.5
1 4 1.1

Sample Code
tmp = load ("Sample File");
spmat = spconvert (tmp);
clear tmp;

--Rik


reply via email to

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