Plot of an curve and its equation
조회 수: 1 (최근 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!



