早教吧作业答案频道 -->其他-->
哪为大哥有三次样条插值MATLAB函数的程序啊,给小弟发个啊,急用!如题!就这多分了,全部送上!
题目详情
哪为大哥有三次样条插值MATLAB函数的程序啊,给小弟发个啊,急用!
如题!就这多分了,全部送上!
如题!就这多分了,全部送上!
▼优质解答
答案和解析
matlab自带三次样条的程序啊
>> help spline
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)
Example:
This generates a sine curve,then samples the spline over a finer mesh:
x = 0:10; y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example:
This illustrates the use of clamped or complete spline interpolation where
end slopes are prescribed.Zero slopes at the ends of an interpolant to the
values of a certain distribution are enforced:
x = -4:4; y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
See also INTERP1,PPVAL,SPLINES (The Spline Toolbox).
>> help spline
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)
Example:
This generates a sine curve,then samples the spline over a finer mesh:
x = 0:10; y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example:
This illustrates the use of clamped or complete spline interpolation where
end slopes are prescribed.Zero slopes at the ends of an interpolant to the
values of a certain distribution are enforced:
x = -4:4; y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
See also INTERP1,PPVAL,SPLINES (The Spline Toolbox).
看了 哪为大哥有三次样条插值MAT...的网友还看了以下:
如图所示,光滑水平面上有一长为L的小车,在小车的一端放有一物体,在物体上施一水平恒力F,使它由静止 2020-05-13 …
长为L的小车置于光滑的水平面上,小车最右端放一小物块用F将小车向右拉动距离s,物块恰好滑到小车的最 2020-05-13 …
怎样分清楚I和l(尤其在书上)我发现i的大写I和L的小写l好难分辨,尤其是在书上看.有什么好方法好 2020-05-16 …
L的小写字母是什么 2020-05-16 …
毫升和升的问题毫升的英文为ml,升的英文是L,那为什么升的英文要大写,不能写l呢?毫升是m和L的小 2020-06-15 …
将一个棱长为n(n是正整数)的正方体木块的表面染上红色,然后切成n3个棱长为l的小正方体,发现只有 2020-06-27 …
根据提示完成(1)-(3)小题春天似乎是小草开学的日子,它们三三两两聚集到一起,在阳光下上课。每当 2020-07-27 …
在算做功的时候,什么时候要用对地位移,什么时候要用相对位移?如题质量为M,长度为L的小车静止在光滑 2020-08-03 …
质量为M,长为L的小船静止浮于河中小船的两头分别站着质量为m1和m2(m1>m2)的人A和B他们同 2020-08-03 …
截取一段长为l(L的小写)的吸管,找一直径为D的钢珠,把钢珠放在吸管上方,再测出管底到球顶部的高度L 2020-11-05 …