help-octave
[Top][All Lists]
Advanced

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

Re: Distinguishing between purely numerical data and alphanumeric data


From: Geraint Paul Bevan
Subject: Re: Distinguishing between purely numerical data and alphanumeric data
Date: Mon, 05 Sep 2005 16:06:27 +0100
User-agent: Debian Thunderbird 1.0.2 (X11/20050817)

Madhusudan Singh wrote:
> Hi
> 
> I have the following two lines in a data file :
> 
> VB= -5 to 5 in 1 step
> 1 -10 -5 3.896E-11 5E-14 -7.841E-11 0.557582 779.2
> 
> I need to tell them apart somehow. I tried :
> 
> all/any (isalpha(string)) % String read in via fgets()
> 
> Both return the same result (thanks to the presence of "E" characters in the 
> line containing just numbers)
> 
> How do I disambiguate between the two ?
> 
> Thanks.


How about  any(str2num(string)) ?


-- 
Geraint Bevan
http://www.mech.gla.ac.uk/~gbevan



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