Smooth curves how to

2 次查看(过去 30 天)
Simba Matema
Simba Matema 2019-7-15
回答: KSSV 2019-7-15
Hi
got three data points and need to join them with smooth curve insted of a straight line.
please help.
commands below..
x=[1 2 3];
y=[1.22 3.31 1.91];
plot(x,y)
hold on
y1=[1.1 1.65 0.60];
plot(x,y1)
hold on
y2=[1.22 3.48 2.44];
plot(x,y2)
hold on
y3=[2.61 2.61 2.39];
plot(x,y3)
hold on
y4=[1.39 2.44 0.87]
y4 =[1.3900 2.4400 0.8700]
plot(x,y4)
hold on
y5=[0.57 0.65 0.28];
plot(x,y5)
hold on
z=[2.0 2.0 2.0];
plot(x,z)

采纳的回答

KSSV
KSSV 2019-7-15
x=[1 2 3];
y=[1.22 3.31 1.91];
xx = min(x):0.1:max(x);
yy = spline(x,y,xx);
plot(x,y,'r',xx,yy,'b')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Smoothing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by