: C = ncCatArray(dim, filenames, varname)
: C = ncCatArray(dim, pattern, varname)
: C = ncCatArray(dim, filenamefun, varname, range)
: C = ncCatArray(… propertyname, properyvalue)

Create an array that represent a concatenated NetCDF variables.

Create a concatenated array from variables (varname) in a list of netcdf files along dimension dim.Individual elements can be accessed by subscripts

e.g. C(2,3) and the corrsponding subset of the appropriate file is loaded

Inputs

dim - dimensions use for variables

varname - variable name to load

filenames - list of filenames as a cell array

pattern - shell wildcard pattern (e.g. file_*.nc)

filenamefunc - a function handle where the i-th filename is filenamefun(range(i)).

propertyname, properyvalue - propery name and value pairs.

Properties

’SameAttributes’: false or true (default). If SameAttribute is true, the variables’ NetCDF attribute of all files are assumed to be the same. Only the attributes of the first file is loaded in this case.

Outputs

C - a concatenated array from the read variables of the files.

Example

data = ncCatArray(3,{'file-20120708.nc','file-20120709.nc'},'SST')

data = ncCatArray(3,'file-*.nc','SST')

data = ncCatArray(3,@(t) ['file-' datestr(t,'yyyymmdd') '.nc'],'SST',...
             datenum(2012,07,08):datenum(2012,07,09));

Note: in Octave the glob function is used to determine files matching the shell wildcard pattern, while in Matlab rdir is used. The function rdir is available from Matlab exchange under BSD license (http://www.mathworks.com/matlabcentral/fileexchange/19550).

Package: ncarray