Smooth curves how to

1 回表示 (過去 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 Center および File ExchangeSmoothing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by