[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading matrix of unknown dimensions from file.
From: |
Mike Miller |
Subject: |
Re: reading matrix of unknown dimensions from file. |
Date: |
Thu, 4 Jul 2002 10:37:17 -0500 (CDT) |
On Thu, 4 Jul 2002, Naïfi G Musonda wrote:
> I have tried to use load in 2.1.35 but still getting "inconsistent
> column on matrix error ". Has any found a way of loading such a matrix?
I believe that is due to unequal numbers of values in the rows of your
input file? Octave needs to produce a matrix which has the same number of
elements in every row.
By the way, is there a way to load a file that looks like this...
1 2 3 4
1 2
1 2 3 4 5
1 2 3
...and have Octave automatically pad with zeros to produce a matrix in
Octave that looks like this?
1 2 3 4 0
1 2 0 0 0
1 2 3 4 5
1 2 3 0 0
That would be a feature I could use. If there isn't already a way to do
this, it would be nice to have a -pad option for Octave's load command.
It might even allow the user to specify what to pad with (e.g., zeros,
ones, NaNs).
If we can't load an "uneven file" in Octave, is there an easy unix method
for fixing the file (i.e., padding zeros to short rows) before loading it
in Octave?
Mike
--
Michael B. Miller, Ph.D.
Assistant Professor
Division of Epidemiology
University of Minnesota
http://taxa.epi.umn.edu/~mbmiller/
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------