全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
316 0
2013-04-05

SPLINE Cubic spline data interpolation.
    PP = SPLINE(X,Y) provides the piecewise polynomial form of the
    cubic spline interpolant to the data values Y at the data sites X,
    for use with the evaluator PPVAL and the spline utility UNMKPP.
    X must be a vector.
    If Y is a vector, then Y(j) is taken as the value to be matched at X(j),
    hence Y must be of the same length as X  -- see below for an exception
    to this.
    If Y is a matrix or ND array, then Y(:,...,:,j) is taken as the value to
    be matched at X(j),  hence the last dimension of Y must equal length(X) --
    see below for an exception to this.

    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.  For information
    regarding the size of YY see PPVAL.

    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.  If Y is a vector, this
    means:
        f(X) = Y(2:end-1),  Df(min(X))=Y(1),    Df(max(X))=Y(end).
    If Y is a matrix or N-D array with SIZE(Y,N) equal to LENGTH(X)+2, then
    f(X(j)) matches the value Y(:,...,:,j+1) for j=1:LENGTH(X), then
    Df(min(X)) matches Y(:,:,...:,1) and Df(max(X)) matches Y(:,:,...:,end).

  x = 0:10;  y = sin(x);
        xx = 0:.25:10;
        yy = spline(x,y,xx);
        plot(x,y,'o',xx,yy)

用三次多项式插值可以使得曲线更加平滑,一阶和二阶连续

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群