.. highlightlang:: us .. index:: nc_varsearch .. _nc_varsearch: nc_varsearch ============ .. us.tag nc_varsearch NOTREADYENGLISH NC_Var New5400 :ref:`nc_varsearch` searches in a given variable for the index of that value that is greater of equal than x. The values in variable must be sorted monotonically increasing and should not contain missing values. .. function:: index = nc_varsearch(ncid, varid, x) .. us.return **Return Value** *index* is the index such that var[index] <= x < var[index+1]. *index* is in the range 0 .. n-1. In case of an error the function returns a value < 0. :ref:`nc_last_error` returns the error code. .. us.params **Parameters** .. uparam:: ncid Identifies the netCDF file. .. uparam:: varid *varid* is the ID of a variable. .. uparam:: x *x* is a scalar value. .. us.comment **Comment** The function can only be used for UniPlot data files. See :ref:`nc_create`. .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2012 (5.40.0) - New. .. seealso:: :ref:`overview-netcdf-files`, :ref:`nc_open`, :ref:`nc_last_error`, :ref:`nc_varinq_info`, :ref:`error_create` :sub:`id-1626420`