Other
This Matlab code provides the radial interpolation methods for multi-dimensional scattered data. The interpolation methods is best used for radial basis function whose values depend only on the distances of the input variables to the origin. An example of the use of the code is shown below.
%1D example
x = 0:1.25:10; f = sin(x);
xi = 0:.1:10;
%Matlab interpolation
fi = interp1(x,f,xi);
% RBF interpolation
rbf=rbfcreate(x, f);
fi = rbfinterp(xi, rbf);
%2D example
x = rand(50,1)*4-2; y = rand(50,1)*4-2; z = x.*exp(-x.^2-y.^2);
ti = -2:.05:2;
[XI,YI] = meshgrid(ti,ti);
%Matlab interpolation
ZI = griddata(x,y,z,XI,YI,'cubic');
%RBF interpolation
rbf=rbfcreate([x'; y'], z');
ZI = rbfinterp([XI(:)'; YI(:)'], op);
ZI = reshape(ZI, size(XI));
Optional parameters:
1
matlab
插值
方法
No comment