help-octave
[Top][All Lists]
Advanced

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

Re: reading NaN with fscanf


From: Gerald Ebberink
Subject: Re: reading NaN with fscanf
Date: Wed, 02 Mar 2005 14:47:34 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


what do you want to do with the NaN, you want them in your data or do
you replace them or even omit them. because if you do you might want to
use sed or a other command-line tool which are designed for these kind
of operations.
Claudio Belotti wrote:
| hi all,
|     I want to read an ascii file like this:
|
| data_name_1 [data_dimension]
| 1
| 2
| 3
| nan
| nan
| 4
| 5
|
| data_name_2 [data_dimension]
| .
| .
|
| after reading the string I use fscanf to get the numerical values,
|
| [this_data,count]=fscanf(fh,"%f",[1,this_dimension]);
|
| but as soon as I found "nan" fscanf returns.
| I handle this checking count and this_dimension, is there a way to let
| fscanf accept both digit and "nan"?
|
| thanks
|
| Claudio
|
|
|
|
| -------------------------------------------------------------
| 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
| -------------------------------------------------------------
|

- --
Ing. Gerald Ebberink
Research Technician

Kernfysisch Versneller Instituut
Rijksuniversiteit Groningen
Zernikelaan 25
9747 AA Groningen
The Netherlands
tel: +31 50 363 3518
lab: +31 50 363 3588
mob: +31 62 460 9930
fax: +31 50 363 4003
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCJcP2bSbfYz8yWIMRAuTfAJ9uAyKIbeunVVaCxsSlODPGW+IRJwCgtozJ
1Qvu1JZaeDWwFvQany7vBTU=
=LuIp
-----END PGP SIGNATURE-----

Attachment: ebberink.vcf
Description: Vcard


reply via email to

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