function var = netcdf_getvar(file, varname) % function var = netcdf_getvar(file, varname) % % simple 'convenience' function to load a variable's data out of % the NetCDF file into a MATLAB variable. % returns a variable of whatever size/type was stored in the file. ncID = netcdf.open(file, 'NC_NOWRITE'); varID = netcdf.inqVarID(ncID, varname); var = netcdf.getVar(ncID, varID); netcdf.close(ncID);