diff main/netcdf/inst/ncwrite.m @ 12711:a4de85b2e6a0 octave-forge

fix bug 47014 and make test code work in matlab
author abarth93
date Fri, 19 Feb 2016 13:45:14 +0000
parents 105114c0833c
children
line wrap: on
line diff
--- a/main/netcdf/inst/ncwrite.m	Mon Feb 15 20:43:15 2016 +0000
+++ b/main/netcdf/inst/ncwrite.m	Fri Feb 19 13:45:14 2016 +0000
@@ -84,10 +84,6 @@
   end    
 end
 
-if ~isempty(fv)
-  x(isnan(x)) = fv;
-end
-
 if ~isempty(offset)
   x = x - offset;
 end
@@ -96,6 +92,10 @@
   x = x / factor;
 end
 
+if ~isempty(fv)
+  x(isnan(x)) = fv;
+end
+
 netcdf_putVar(gid,varid,start-1,count,stride,x);
 
 netcdf_close(ncid);