.. highlightlang:: us .. _nc_varget: nc_varget ========= .. index:: nc_varget .. us.tag nc_varget ENGLISH NC_Var :ref:`nc_varget` reads data values from a netCDF variable of an open netCDF file. The file must be in data mode. .. function:: values = nc_varget(ncid, varid) values = nc_varget(ncid, varid, rvStart, rvCount) values = nc_varget(ncid, varid, rvStart, rvCount, bCharAsByte) .. us.return **Return Value** *values* is a vector with data values if the dimension of the variable is 1. *values* is a matrix with data values if the dimension of the variable is 2. If the dimension of the variable is of higher order, *values* is a vector with data values. .. us.params **Parameters** .. uparam:: ncid Identifies the netCDF file. .. uparam:: varid *varid* is the ID of a variable. .. uparam:: rvStart *rvStart* is a vector of values specifying the multidimensional index of the corner of the hyperslab where the first of the data values will be read from. The size of *start* must be the same as the number of dimensions of the specified variable. The elements of *start* must correspond to the variable's dimensions in order. .. uparam:: rvCount *rvCount* is a vector of values specifying the multidimensional edge lengths from the corner of the hyperslab where the first of the data values will be read. To read a single value, for example, specify *rvCount* as [1,1,...,1]. The size of *rvCount* is the number of dimensions of the specified variable. The elements of *rvCount* correspond to the variable's dimensions. .. uparam:: bCharAsByte If *bCharAsByte* is TRUE (1) characters will be returned as byte values (data type = NC_CHAR). For other data type this parameter has no meaning. Default value is FALSE (0). .. seealso:: :ref:`overview-netcdf-files`, :ref:`nc_create`, :ref:`nc_open`, :ref:`nc_endef`, :ref:`nc_redef`, :ref:`nc_varput`, :ref:`strchar`, :ref:`auto_GetData` :sub:`id-545369`