MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB图像处理] matlab中绘制曲线的问题 (https://www.labfans.com/bbs/showthread.php?t=7764)

jerrydecn 2009-04-17 14:40

matlab中绘制曲线的问题
 
请问如果知道x和y两组数,如何直接绘制出相应的曲线图?用plot的话出来的是折线图
记得在帖子上有高人直接用spline,请问如何使用?谢谢

silas_xue 2009-04-17 20:12

回复: matlab中绘制曲线的问题
 
lz 个人建议 可以参考MatlAB中help有关plot的说明 且有例子

Thx for reading.
PS:若还算满意,直接点击“Thanks”,再次登陆时亦便于查看回答是否真的帮到你了。
个人观点 仅供参考 多多交流 相互学习

laosam280 2009-04-17 22:18

回复: 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),'-');

zhang770729 2009-04-18 01:21

回复: matlab中绘制曲线的问题
 
这个主要是关于曲线拟合以及插值的计算,在帮助中查polyfit or interp function!


所有时间均为北京时间。现在的时间是 06:15

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.