help-octave
[Top][All Lists]
Advanced

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

Re: large input data


From: Joe Koski
Subject: Re: large input data
Date: Wed, 11 Jan 2006 14:22:15 -0700
User-agent: Microsoft-Entourage/11.2.1.051004

A more flexible way to read an ascii file, (but much slower during
execution) is to read files line-by-line with fscanf(fileid,template,"C").
Where template is the same as C format definitions ('%i%f%g', etc.). If the
file's not too large, you can pick your way through, skipping lines,
changing format in the middle, etc. See the octave manual for details.

Another trick for reading several inputs on one line is the read the numbers
(for example: 1.5,3,10) as a string, and then use str2num to get the
numerical values.  

Joe


on 1/11/06 1:56 PM, Robert A. Macy at address@hidden wrote:

> Similar requirement.  Sometimes the data is scooped up from
> an Excel spread sheet, or sometimes just a lot of terms.
> 
> I use a text editor (sometimes notepad) to make an ascii
> data file, dataset.txt.  Include "fake" headers at the top
> of the file [those five lines at the top, describing what
> the data is] to make it look like a standard ascii style
> octave file.  
> 
> then use...
>>> load -force "dataset.txt";
> ...to load it in, and overwrite the specific variable.
> 
>             - Robert -
> 
> On Wed, 11 Jan 2006 18:47:56 +0000 (GMT)
>  Hayden Rampadarath <address@hidden> wrote:
>> Hi,
>>    
>>   i am using GNU Octave version 2.1.71, in Cygwin for my
>> research project, and have a lot of input data. i would
>> like to know an easier method than typing them in. Can i
>> do some thing for it to read it from say notepad, or
>> something??
>>    
>>   Also, how do i make and save plots using this version??
>>    
>>    
>>   Thanks 
>>   Hayden
> 
> 
> 
> -------------------------------------------------------------
> 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
> -------------------------------------------------------------
> 




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