Load variables from a NetCDF archive file.

load_nc(fname)   %Matlab & Octave
X <- load_nc(file, which_vars=NULL)   #R

Load variables from a NetCDF archive file. The file is assumed to be in the current working directory unless a pathname is added to the beginning of fname. If no output argument is given, the variables will be created in the current workplace, overwriting any variables with the same name that are already there. If an output argument is given, the variables will be stored as fields of a structure.

Input var Description Default
fname is the name of the metadata file. If the name does not include a .nc suffix, this will be added automaticallyN/A
which_vars (#R) (Optional) A list of quoted character strings giving the exact names of variables to be read in. Default is to read all variables present in the file. parameters should be read in.all variables
Output var Description
X if specified, is a structure/list containing sensor and metadata structures. The field names in X will be the same as the names of the variables in the NetCDF file, e.g., if the file contains A and P, X will have fields X.A, X.P and X.info (the file metadata) in Matlab/Octave or X$A , X$P, X\$info in R.

### Matlab & Octave

load_nc('testset1')

### R

load_nc('testset1.nc')