| Contents | Index |
Interpolant for gridded data
The griddedInterpolant class constructs an interpolant F from a gridded data set. The interpolant F is an interpolating function that can be evaluated at query locations.
F = griddedInterpolant(x,v) takes vectors x and v of equal length and creates an interpolant F. The first input argument, x, is a vector of sample points. v is a vector of corresponding values such that v = f(x). The interpolant F interpolates a vector of query locations xq using vq = F(xq) to return the interpolated values vq.
F = griddedInterpolant(X1,X2,...,Xn,V) specifies a grid as n n-dimensional arrays Xi. The grid (X1, X2,...,Xn) is created from grid vectors xgi by [X1,X2,...,Xn] = ndgrid(xg1,xg2,...,xgn).
F = griddedInterpolant(V) creates an interpolant F through the n-dimensional array of values V using the default grid formed by grid vectors xgi = 1:size(V,i).
F = griddedInterpolant({xg1,xg2,...,xgn},V) specifies the grid in compact form in terms of grid vectors xgi, where length(xgi) is size(V,i).
F = griddedInterpolant(...,Method) specifies the interpolation method. The values for 'Method' are nearest, linear (default), spline, pchip, or cubic.
The interpolant F can be evaluated on scattered or gridded query locations.
The interpolant F can be evaluated on scattered or gridded query locations as follows:
Vq = F(Xq) evaluates F at the query locations Xq to produce the corresponding values Vq. The m-by-n matrix Xq represents m points scattered in n-dimensional space. Vq is m-by-1.
Vq = F(xq1,xq2,...,xqn) specifies the query locations xqi as column vectors of length m representing m points scattered in n-dimensional space. Vq is m-by-1.
Vq = F(Xq1,Xq2,...,Xqn) specifies the query locations as n n-dimensional arrays Xqi of equal size specifying the full grid. Vq is the same size as Xqi.
Vq = F({xgq1,xgq2,...,xgqn}) specifies the query locations as a grid formed by the grid vectors xgqi. Vq is the size of grid defined by xgqi, length(xgq1)-by-length(xgq2)-by- . . . -by-length(xgqn).
A gridded data set is an axis-aligned, ordered set of points.
A scattered data set consists of a set of points where the points have no structure among their relative locations.
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.
Index-based editing of the properties of F are not supported. Instead, wholly replace the GridVectors or Values arrays as necessary. See Interpolation with the griddedInterpolant Class in the MATLAB Mathematics documentation for more information.
Interpolate to refine a grid-based sampling:
[X1, X2] = ndgrid(1:10,1:10); V = X1.^2 + X2.^2; F = griddedInterpolant(X1,X2,V, 'cubic'); [Xq1, Xq2] = ndgrid(1:0.5:10,1:0.5:10); Vq = F(Xq1,Xq2); mesh(Xq1,Xq2,Vq);

interp1 | interp2 | interp3 | interpn | meshgrid | ndgrid | TriScatteredInterp
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |