help-octave
[Top][All Lists]
Advanced

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

load ASCII file with "NaN"


From: John W. Eaton
Subject: load ASCII file with "NaN"
Date: Tue, 26 Oct 1999 17:35:31 -0500 (CDT)

On 25-Oct-1999, Andy Jacobson <address@hidden> wrote:

|       Is there any way to recognize the string "NaN" during ASCII
|       input?  I get the following surprising result:

No.  There was a discussion about this some time back.

| $ cat > test.dat
| 1 2 NaN 3
| $ octave
| Octave, version 2.0.13.95 (i386-pc-linux-gnu).
| Copyright (C) 1996, 1997, 1998 John W. Eaton.
| This is free software with ABSOLUTELY NO WARRANTY.
| For details, type `warranty'.
| 
| octave:1> load test.dat
| octave:2> test
| test =
| 
|   1  2  2  2

I've fixed my sources so that this will at least give you an error,
and not silently load the wrong data.

If you want to read and write NaN and Inf data reliably, use binary
files.

jwe



---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------



reply via email to

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