starbinbin_csu 发表于 2010-11-6 21:42:21

matlab样条工具箱的一些问题

使用csapi函数的csapi(x,y)用法产生的结构体
有以下成员,分别是什么啊?
有:form:
breaks:
coefs:
pieces:
order:
dim:
另外样条工具箱的help感觉这些都没有讲到,有没有好的相关书推荐一下啊?

Walker0728 发表于 2010-11-6 21:51:32

看看帮助文档的解释
help csapi
CSAPI Cubic spline interpolant with not-a-knot end condition.

    PP= CSAPI(X,Y)returns the cubic spline interpolant (in ppform) to the
    given data (X,Y) using the not-a-knot end conditions.
    The interpolant matches, at the data site X(j), the given data value
    Y(:,j), j=1:length(X). The data values may be scalars, vectors, matrices,
    or even ND-arrays. Data points with the same site are averaged.
    For interpolation to gridded data, see below.

    CSAPI(X,Y,XX)is the same as FNVAL(CSAPI(X,Y),XX).

    For example,

       values = csapi([-1:5]*(pi/2),[-1 0 1 0 -1 0 1], linspace(0,2*pi));

    gives a surprisingly good fine sequence of values for the sine over its
    period.

    It is also possible to interpolate to data values on a rectangular grid,
    as follows:

    PP = CSAPI({X1, ...,Xm},Y)returns the m-cubic spline interpolant (in
    ppform) that matches the data value Y(:,j1,...,jm) at the data site
    (X1(j1), ..., Xm(jm)), for ji=1:length(Xi) and i=1:m.
    The entries of each Xi must be distinct.Y must have size
    , withda vector of natural numbers, and
    with an emptydacceptable when the function is to be scalar-valued.

    CSAPI({X1, ...,Xm},Y,XX)is the same as FNVAL(CSAPI({X1,...,Xm},Y),XX).

    For example, the statements

       x = -1:.2:1; y=-1:.25:1; = ndgrid(x,y);
       z = sin(10*(xx.^2+yy.^2)); pp = csapi({x,y},z);
       fnplt(pp)

    produce the picture of an interpolant to a bivariate function.
    Use of MESHGRID instead of NDGRID here would produce an error.

    See also csape, spapi, spline, ndgrid.


    Reference page in Help browser
       doc csapi

starbinbin_csu 发表于 2010-11-6 22:18:51

2# Walker0728
我看了帮助文档的解释,可是并没有解释那个结构体的参数啊?

lengyunfeng 发表于 2010-11-7 10:19:36

像这种情况,我觉得你可以去看看数值方法方面的书,有因才有过嘛。三次样条插值有几个问题你要弄清楚,就是你有的是什么,能得到的是什么。比如三次样条插值针对的是3组数据(好像是,记不大清了),那如果你数据组数一多,那就有很多分段方程了,那pieces似乎就可以理解了,breaks也可以理解了(断点嘛),coefs也可以理解了(系数嘛),等等等等。不过这里的form不好理解,看了一下help,应该是区分插值函数和插值点值的一个量,用以区分csapi(X,Y,XX)和csapi(X,Y)。个人理解,仅供参考

starbinbin_csu 发表于 2010-11-7 19:07:35

4# lengyunfeng
非常感谢!,这里的form貌似help文档上说了,是指样条函数的形式,matlab工具箱中提供B形式的样条和pp形式的样条
页: [1]
查看完整版本: matlab样条工具箱的一些问题