.. highlightlang:: us .. index:: griddata .. _griddata: griddata ======== .. us.tag griddata ENGLISH interpol-2d New5200 :ref:`griddata` creates a regular grid of arbitrarily distributed data triples. .. function:: rmZi = griddata(rvX, rvY, rvZ, rvXi, rvYi) rmZi = griddata(rvX, rvY, rvZ, rvXi, rvYi, nOption) rmZi = griddata(rvX, rvY, rvZ, rvXi, rvYi, ssOption) .. us.return **Return Value** *rmZi* is the interpolated z value matrix for the given *rvXi* and *rvYi* coordinates. In case of an error *rmZi* is an error object (see example). .. us.params **Parameters** .. uparam:: rvX *rvX* is a real vector with at least 4 elements. .. uparam:: rvY *rvY* is a real vector with at least 4 elements. The number of points must be identical with *rvX*. .. uparam:: rvZ *rvZ* is a real vector with at least 4 elements. The number of points must be identical with *rvX*. .. uparam:: rvXi *rvXi* is a real vector with at least one point. .. uparam:: rvYi *rvYi* is a real vector with at least one point. .. uparam:: ssOption See *nOption*. .. uparam:: nOption Is one of the following values: .. list-table:: :header-rows: 1 * - ssOption - nOption - * - "linear" - 1 - Linear interpolation. * - "cubic" - 2 - cubic spline interpolation. * - "tps" oder "thin-plate-spline" - 3 - Thin-Plate-Spline interpolation. * - "poly1" or "plane" - 4 - * - "poly2" - 5 - * - "poly3" - 6 - * - "interp1d-bilinear" - 7 - .. us.example **Example** If an error occurred, :ref:`griddata` returns an error object (see also :ref:`error_create`). :: def test_griddata() { srand(1); x = rand(100, 1)*15-7.5; y = rand(100, 1)*15-7.5; r = sqrt(x.*x + y.*y); z = sin(r)./r; xi = linspace(-7.5, 7.5, 40) yi = xi; zi = griddata(x, y, z, xi, yi, "thin-plate-spline"); if (type(zi) == "error") { MessageBoxError(zi.message); return FALSE; } plotxyz(xi, yi, zi); return TRUE; } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.20 - New. .. seealso:: :ref:`overview-mathematic`, :ref:`fspline2`, :ref:`smooth2`, :ref:`XYZGetInterpolationType` :sub:`id-1546570`