|
From: | Alexander Barth |
Subject: | Re: octcdf questions |
Date: | Fri, 7 Jun 2013 15:38:32 +0200 |
Hi Alexander,
Thank you for your response, now it is clear to me how autonan and autoscale work.
Probably a comment in the documentation's example would help here.
BTW which are the actual names: ncautonan and ncautoscale or autonan and autoscale?
The later are undefined in my version of octave with ocatve-octcdf.Regarding the other failure, I realized it only happens to me with variables with several dimensions (e.g matrices).
This probably points out to a misuse. Let me reword my example (forgetting autonan and autoscale issue):nc('dim1') = 3;nc('dim2') = 2;nc{'var2'} = ncdouble('dim1', 'dim2');nc{'var1'} = ncdouble('dim1');
nc{'var1'}(:) = rand(3,1); % this works.
nc{'var1'}(1:3) = rand(3,1); % this works, too.
nc{'var2'}(:) = rand(3,2); % this works.
nc{'var2'}(1:6) = rand(3,2); % this fails: octcdf: unknown index specification: type <unknown_type>
nc{'var2'}(:,:) = rand(3,2); % this works.
nc{'var2'}(1:3,1:2) = rand(3,2); % this works, too.
So does it mean that I should explicitly indicate the slice along EACH DIMENSION?
Another possibility is to use either a single magic colon, or a magic colon for each dimension. Will the last option work with variables with record dimensions?
Thanks again!2013/5/28 Alexander Barth <address@hidden>
Hi Joan
For autonan and autoscale you should do something like this:What is strange is that both assignments work for me using octcdf 1.1.6 and octave 3.6.2
nv(:) = 1:5; % to use the autonan and autoscale
nv(1:5) = 1:5;
or in this form:
nc{'var1'}(1:5) = 1:5; % without autonan and autoscaleWhat does happen when you try "nv(1:5) = 1:5;" ?
Can you run nctest?
Joan Pau Beltran
[Prev in Thread] | Current Thread | [Next in Thread] |