help-octave
[Top][All Lists]
Advanced

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

Re: Handling unusual number conditions


From: Madhusudan Singh
Subject: Re: Handling unusual number conditions
Date: Tue, 6 Sep 2005 00:28:13 -0400
User-agent: KMail/1.7.2

Thanks for your response.

Consider the following line from the data file :

63 -5.6 -4 1.386E-11 0 -1.476E-11 0.533678 Overflow

The code looks like :
s=fgets(fid);
strs=split(s,' ');
dataline=str2num(strs)
....

str2num fails with Overflow obviously.

I could use a Python solution, but I would rather have a solution that is as 
Matlab compatible as possible.


On Tuesday 06 September 2005 12:09 am, Sameet Mehta wrote:
> HI,
> for such string handling you could use python with octave, that should
> solve your problem.  If you give some specific example i will be able to
> help.
>
> regards
> Sameet
>
> Madhusudan Singh wrote:
> >Hi
> >
> >My measurement sometimes generates some unusual numbers. In the data file,
> >this sometimes reads as :
> >
> > Overflow
> >
> >in a column full of numbers.
> >
> >Can Octave handle this gracefully in some fashion ? The way I read in data
> > is to read one line at a time, and then apply str2num to that string to
> > extract the numbers.
> >
> >And the output of the measurement *cannot* be modified. So any suggestions
> >other than that could be useful.
> >
> >Thanks.
> >
> >
> >
> >-------------------------------------------------------------
> >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]