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

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

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the approximation class.

Syntax

z2 = interp2(z1, times)

z2 = interp2(z1, x2, y2)

z2 = interp2(x1, y1, z1, x2, y2)

z2 = interp2(x1, y1, z1, x2, y2, method)

Description

Interpolates z-values based on sample data using a specified method.

Examples

Inputs

Name Description
z1 Specifies the sample z-values. z1 is a real, double-precision matrix.
times Specifies the number of times LabVIEW must interpolate recursively between the given points. Specifically, LabVIEW adds 2^(times)-1 points between each given set of points. times is an integer.
x2 Specifies the x-values at which you want to interpolate z-values. x2 is a real, double-precision vector.
y2 Specifies the y-values at which you want to interpolate z-values. y2 is a real, double-precision vector.
x1 Specifies the sample x-values. If you do not specify x1, LabVIEW sets x1 to the values of 0 ... m-1 where [m, n] equals size(z1). x1 is a real, double-precision vector.
y1 Specifies the sample y-values. If you do not specify y1, LabVIEW sets y1 to the values of 0 ... n-1 where [m, n] equals size(z1). y1 is a real, double-precision vector.
method Specifies the interpolation method to use. method is a string that accepts the following values.

'cubic' Performs cubic Hermite interpolation.
'linear' (default) Performs linear interpolation.
'nearest' Chooses the z1 value corresponding to the (x1, y1) value that is nearest to the current z2 value. LabVIEW sets the interpolated value to the nearest data point.
'spline' Performs spline interpolation.

Outputs

Name Description
z2 Returns the z-values interpolated at the values of (x2, y2). z2 is a real, double-precision matrix.

Examples

Z1 = zeros(10, 10);
for i = 1:10
for k = 1:10
Z1(i, k) = i^2+4*i+3*k^4-2*k;
end
end
Z2 = interp2(Z1, 2);

Related Topics

interp
interp1
interpft


Resources


 

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