Plot of an curve and its equation
6 ビュー (過去 30 日間)
古いコメントを表示
Hello;
I'm trying to get an equation of the plot and before trying to get this I got this plot to see if I can catch it truly and it does.
And here what I ve done till now;
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
a=polyfit(x,y,9);
b=polyval(a,x);
plot(x,y,'ro',x,b)
And What I would like to have is the equation of this plot but once I tried to write the equation with the values from polyfit output I got a plot something completely different. May someone please help me? Thank you so much in advance..
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
c= [214387.3975 -859079.8412 1444444.664 -1323346.187 717335.5313 -233431.4118 44018.3122 -4332.146236 165.7218241 0.584459303];
vel = c.*x';
plot(x,vel,'b','LineWidth',2)
0 件のコメント
採用された回答
VBBV
2022 年 11 月 5 日
編集済み: VBBV
2022 年 11 月 5 日
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
a=polyfit(x,y,9)
b=polyval(a,x)
plot(x,y,'ro',x,b)
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
c= [214387.3975 -859079.8412 1444444.664 -1323346.187 717335.5313 -233431.4118 44018.3122 -4332.146236 165.7218241 0.584459303];
vel = max(b.*x')
plot(x,vel,'b-','LineWidth',2)
2 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!