help-octave
[Top][All Lists]
Advanced

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

Re: load numbers from a txt file


From: Josh Rigler
Subject: Re: load numbers from a txt file
Date: Sun, 30 Dec 2007 09:55:09 -0700
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Ben Abbott wrote:
On Dec 30, 2007, at 11:59 PM, Jean-Marie Bonnaz wrote:

Hello

I am a complete beginner with octave and I have some problems. I usually run Matlab but I try to learn Octave.
My problem is :
I would like to read numbers in a text file (file.txt). In this file there are only numbers, spaces ... and no text. The numbers are arranged in columns and columns are separated by one space.

I don't know how to read this file with Octave in order to load the numbers in a matrix.

With Matlab I use the function 'read' but I don't know what is the equivalent function in Matlab.

Thank you if you could help me.

Jean-Marie (France)

Try

data = load ('-ascii', filename.txt);

Ben

p.s. works in Matlab as well.

Ben beat me to it. One of these days I'll get to one of these low-hanging fruit first.

I'd just add that as far as my system at work is concerned, there is no such function as 'read' in ML. Maybe 'textread', but this is available if you install Octave-forge.

-EJR


reply via email to

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