14 |
else;%try to use old mex stuff |
else;%try to use old mex stuff |
15 |
% inverse the order of list dimensions |
% inverse the order of list dimensions |
16 |
dimlist=fliplr(dimlist); |
dimlist=fliplr(dimlist); |
17 |
ncvar(varname,xtype,dimlist,ncid); |
switch length(dimlist) |
18 |
|
case 1, |
19 |
|
eval(sprintf('ncid{''%s''}=nc%s(''%s'');',varname,xtype,dimlist{1})); |
20 |
|
case 2, |
21 |
|
eval(sprintf('ncid{''%s''}=nc%s(''%s'',''%s'');',varname,xtype,dimlist{1},dimlist{2})); |
22 |
|
case 3, |
23 |
|
eval(sprintf('ncid{''%s''}=nc%s(''%s'',''%s'',''%s'');',varname,xtype,dimlist{1},dimlist{2},dimlist{3})); |
24 |
|
otherwise |
25 |
|
error('ncdefVar: number of dimension > 3'); |
26 |
|
end |
27 |
end; |
end; |
28 |
|
|
29 |
|
|
|
|
|
|
|
|