主题: [MATLAB图像处理] matlab中绘制曲线的问题
查看单个帖子
旧 2009-04-17, 22:18   #3
laosam280
高级会员
 
注册日期: 2008-11-07
住址: 湖南长沙
帖子: 233
声望力: 21
laosam280 正向着好的方向发展
默认 回复: matlab中绘制曲线的问题

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),'-');
__________________
坚持就是胜利,努力就有奇迹。
laosam280 当前离线   回复时引用此帖