changeset 22731:2cc35915bdc0

importdata.m: Return NaN instead of 0 if file is missing a value (bug #49546). * importdata.m: Call dlmread with "emptyvalue" option of NaN for Matlab compatibility.
author Rik <rik@octave.org>
date Mon, 07 Nov 2016 08:06:36 -0800
parents 66d73a5a48b0
children c426d8ec521d
files scripts/io/importdata.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/io/importdata.m	Sun Nov 06 16:38:06 2016 -0800
+++ b/scripts/io/importdata.m	Mon Nov 07 08:06:36 2016 -0800
@@ -243,10 +243,10 @@
   ## Now, let the efficient built-in routine do the bulk of the work.
   if (delimiter == " ")
     output.data = dlmread (fname, "", header_rows, header_cols,
-                           "emptyvalue", NA);
+                           "emptyvalue", NaN);
   else
     output.data = dlmread (fname, delimiter, header_rows, header_cols,
-                           "emptyvalue", NA);
+                           "emptyvalue", NaN);
   endif
 
   ## Go back and correct any individual values that did not convert.