最简单的多项式拟合
P = POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of
三次样条插值
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.
bezier曲线
function [X,Y]=bezier(x,y)
%用法:
%bezier(x,y)
%
%h=bezier(x,y)
%
%[X,Y]=bezier(x,y)
%
%例子:
%bezier([5,6,10,12],[0 5 -5 -2])
n=length(x);
t=linspace(0,1);
xx=0;yy=0;
for k=0:n-1
end
if nargout==2
end
h=plot(xx,yy);
if nargout==1
end
end