help-octave
[Top][All Lists]
Advanced

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

Including NaNs in a data file?


From: Alasdair McAndrew
Subject: Including NaNs in a data file?
Date: Wed, 5 Nov 2014 23:55:47 +1100

I'm setting up a matrix of student marks; using NaNs for non-existent data: a question not attempted.  I'd like to be able to store this as ascii text outside of Octave, with a row looking something like

5 2 N 3 4 N N 3 6 4

the N's indicating questions not attempted.  I can read this into Octave with "fileread", and I get a long string, which I can then fiddle with to turn into numeric values and NaNs.  The function "dlmread" is more convenient, but converts all non-numeric data to zeros.

Is there an easy way to store NaNs in an ascii file, and how then can that file be best read into Ocatve?

Thanks,
Alasdair



--
http://www.facebook.com/alasdair.mcandrew https://plus.google.com/+AlasdairMcAndrew/posts https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108 https://twitter.com/amca01 http://numbersandshapes.net

reply via email to

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