Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

griddata (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the geometry class.

Syntax

ZS = griddata(X, Y, Z, XS, YS)

ZS = griddata(X, Y, Z, XS, YS, method)

[XS, YS, ZS] = griddata(X, Y, Z, XS, YS)

[XS, YS, ZS] = griddata(X, Y, Z, XS, YS, method)

Description

Fits a surface to the unevenly distributed sample points that you specify. The resulting fit passes through all the specified sample points.

Examples

Inputs

Name Description
X Specifies the x-coordinates. X is a vector or a real matrix. If X is a vector, LabVIEW converts X into a matrix by repeating the vector.
Y Specifies the y-coordinates. Y is a vector or a real matrix of the same size as X. If Y is a vector, LabVIEW converts Y into a matrix by repeating the vector.
Z Specifies the z-coordinates. Z is a real matrix of the same size as X.
XS Specifies a real matrix of x-coordinates that represent the x-coordinates of the interpolation points.
YS Specifies a real matrix of y-coordinates that represent the y-coordinates of the interpolation points.
method Specifies the interpolation method to use. method is a string that accepts the following values.

'linear' (default) Linear interpolation (non-smooth)
'cubic' Cubic interpolation (smooth)
'nearest' Nearest neighbor method (non-smooth)
'v4' Biharmonic Spline interpolation (smooth)

Outputs

Name Description
XS Returns the input matrix XS unchanged.
YS Returns the input matrix YS unchanged.
ZS Returns a real matrix that represents the calculated surface at (XS, YS).

Examples

X = rand(5, 5);
Y = rand(5, 5);
Z = X.^2+Y.^2;
[XS, YS] = meshgrid(0:0.1:1);
[XS, YS, ZS] = griddata(X, Y, Z, XS, YS, 'v4');
surf(XS, YS, ZS)

Related Topics

convhull
delaunay
meshgrid
rand
surf


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit