help-octave
[Top][All Lists]
Advanced

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

How to load file with variable length lines?


From: Mike Miller
Subject: How to load file with variable length lines?
Date: Mon, 17 Oct 2005 22:17:14 -0500 (CDT)

Suppose I have a file called x.txt with three lines that looks like this:

1
1 2
1 2 3

I would be happy to have it load into Octave with, say, this form:

1 NaN NaN
1  2  NaN
1  2   3

That is, I want to pad the ends of shorter lines with NaNs (or anything else you can come up with). Is there an Octave function that will do this for me?

I see the function "aload" but I can't get it to do what I want. If no such function exists, I may be able to create one.

Mike



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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