changeset 10607:76a625eefc1e octave-forge

(none)
author abarth93
date Tue, 31 Jul 2012 14:33:36 +0000
parents 1c20b66b2325
children a4909280179a
files main/octcdf/inst/ncinfo.m main/octcdf/inst/ncread.m
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/main/octcdf/inst/ncinfo.m	Tue Jul 31 14:32:53 2012 +0000
+++ b/main/octcdf/inst/ncinfo.m	Tue Jul 31 14:33:36 2012 +0000
@@ -41,7 +41,12 @@
     tmp.Length = dims{i}(:);
     % requires octcdf 1.1.6
     %tmp.Unlimited = isrecdim(dims{i});
-    vinfo.Dimensions = [vinfo.Dimensions; tmp];
+    
+    if isempty(vinfo.Dimensions)
+      vinfo.Dimensions = [tmp];
+    else
+      vinfo.Dimensions(i) = tmp;
+    end
 end
 
 
@@ -55,7 +60,12 @@
     
     tmp.Name = nm;
     tmp.Value = na{j}(:);
-    vinfo.Attributes = [vinfo.Attributes; tmp];
+    
+    if isempty(vinfo.Attributes)      
+      vinfo.Attributes = [tmp];
+    else
+      vinfo.Attributes(j) = tmp;
+    end
 end
 
 vinfo.FillValue = fillval(nv);
--- a/main/octcdf/inst/ncread.m	Tue Jul 31 14:32:53 2012 +0000
+++ b/main/octcdf/inst/ncread.m	Tue Jul 31 14:33:36 2012 +0000
@@ -77,6 +77,11 @@
 end
 
 x = permute(x,[ndims(x):-1:1]);
+
+if length(count) < 2
+    count(2) = 1; 
+end
+
 x = reshape(x,count);
 close(nc)