Line | |
---|
1 | function varsize = nc_varsize(ncfile, varname) |
---|
2 | % NC_VARSIZE: return the size of the requested netncfile variable |
---|
3 | % |
---|
4 | % VARSIZE = NC_VARSIZE(NCFILE,NCVAR) returns the size of the netCDF variable |
---|
5 | % NCVAR in the netCDF file NCFILE. |
---|
6 | % |
---|
7 | |
---|
8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
9 | % |
---|
10 | % $Id: nc_varsize.m 2659 2009-04-01 17:38:36Z johnevans007 $ |
---|
11 | % $LastChangedDate: 2009-04-01 13:38:36 -0400 (Wed, 01 Apr 2009) $ |
---|
12 | % $LastChangedRevision: 2659 $ |
---|
13 | % $LastChangedBy: johnevans007 $ |
---|
14 | % |
---|
15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
16 | |
---|
17 | error(nargchk(2,2,nargin,'struct')); |
---|
18 | error(nargoutchk(1,1,nargout,'struct')); |
---|
19 | |
---|
20 | if ~ischar(ncfile) |
---|
21 | error ( 'SNCTOOLS:NC_VARSIZE:badInputType', 'The input filename must be a string.' ); |
---|
22 | end |
---|
23 | if ~ischar(varname) |
---|
24 | error ( 'SNCTOOLS:NC_VARSIZE:badInputType', 'The input variable name must be a string.' ); |
---|
25 | end |
---|
26 | |
---|
27 | |
---|
28 | v = nc_getvarinfo ( ncfile, varname ); |
---|
29 | |
---|
30 | varsize = v.Size; |
---|
31 | |
---|
32 | return |
---|
33 | |
---|
Note: See
TracBrowser
for help on using the repository browser.