.. highlightlang:: us .. _reduce3d: reduce3d ======== .. index:: reduce3d .. us.tag reduce3d ENGLISH interpol-2d New5102 :ref:`reduce3d` removes data points from an x/y/z dataset. .. function:: idx = reduce3d(rvX, rvY, rvZ, nClasses, nType) .. us.return **Return Value** *idx* .. us.params **Parameters** .. uparam:: rvX *rvX* is a vector with x-coordinates. .. uparam:: rvY *rvY* is a vector with y-coordinates. .. uparam:: rvZ *rvZ* is a vector with z-coordinates. .. uparam:: nClasses *nClasses* is a number in the range 2 to 1000 (Default value is 100). The parameter specifies the number of bins in the x- and y-directions. For a negative value the bins are moved by a half of the bin width. .. uparam:: nType *nType* is on of the following values (Default value is 5): .. list-table:: :header-rows: 1 * - Wert - Bedeutung * - 0 or "first" - First point of each bin will be used. * - 1 or "last" - Last point of each bin will be used. * - 2 or "zmin" - The point with smallest z-value for each bin. * - 3 or "zmax" - The point with greatest z-value for each bin. * - 4 or "mean" - The point that is closest to the mean value will be used. * - 5 or "median" - The point that is closest to the median point will be used. .. us.comment **Comment** The data is categorized into bins in the x- and y-direction. For each bin only one data point is used depending of the nType parameter. For a grid of 100 by 100 bins, the number of data points is reduced to 10,000 data points. Because not all bins contain points the number is usually smaller. If all points lie on a straight line, only 100 points are returned. NaNs (0/0), Infs (1/0), Missing Values (1e10) and values smaller than -1e10 or greater than 1e10 are removed as well. .. us.example **Example** :: def XYZFilterCallback(x, y, z) { return reduce3d(x,y,z, 40, "median"); } def test_xyz() { x = rand(100000, 1)*15-7.5; y = rand(100000, 1)*15-7.5; r=sqrt(x.*x + y.*y); z=sin(r)./r; plotxyz(x,y,z); } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.10.2 - New. .. seealso:: :ref:`overview-xyz-datasets`, :ref:`XYZCreate` :sub:`id-1623504`