Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
高级会员
注册日期: 2008-11-07
住址: 湖南长沙
帖子: 233
声望力: 21 ![]() |
![]()
spline函数是计算在给定点的插值。
Matlab给出了如下的两个例子: Example: This generates a sine-like spline curve and samples it 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. In this example, 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),'-');
__________________
坚持就是胜利,努力就有奇迹。 |
![]() |
![]() |