非均匀有理B样条的源代码 最好用MATLAB做 谁知道啊 急用

来源:百度知道 编辑:UC知道 时间:2024/05/27 20:21:07
C++的也可以
MFC+OPENGL 太麻烦了
最好是MATLAB C++也可以

这个行吗?spline的源代码。

function output = spline(x,y,xx)
%SPLINE Cubic spline data interpolation.
% YY = SPLINE(X,Y,XX) uses cubic spline interpolation to find YY, the values
% of the underlying function Y at the points in the vector XX. The vector X
% specifies the points at which the data Y is given. If Y is a matrix, then
% the data is taken to be vector-valued and interpolation is performed for
% each column of Y and YY will be length(XX)-by-size(Y,2).
%
% PP = SPLINE(X,Y) returns the piecewise polynomial form of the cubic spline
% interpolant for later use with PPVAL and the spline utility UNMKPP.
%
% Ordinarily, the not-a-knot end conditions are used. However, if Y contains
% two more values than X has entries, then the first and last value in Y are
% used as the endslopes for the cubic spline. Namely:
% f(X) = Y(:,2:end-1), df(min(X)) = Y(:,1), df(max(X)) = Y(:,end)