I need some help with Curve Fitting
이전 댓글 표시
Hello!
I have two vectors as shown here
volume = 1:7;
pressure = [3102,2385,1344,886,623,452,411];
I want to have them, fit curves to the data with first-,second-, and third-order polynomails. I want to use polyfit and polyval.
Then I want to plot the three fitted functions on the same graph. I think I want to have a stepsize of 0.2m^3 in order to smooth the curves.
Next I want to plot the actual data from the table on the same graph as the fitted curves, With (im not sure if you can do this) unconnected circles
And then finnally I want to use legend lebels like this 1st order, 2nd order,3rd order and original data.
And would it be possible to treat the volume as the independent (x) variable and treat the pressure as the dependent (y) variable?
Would any of you be able to help me with this?
Please let me know
Thanks
댓글 수: 3
Star Strider
2021년 8월 6일
This sounds suspiciously like homework!
See the relevant function documentation for examples on how to do all of this.
.
Daniel Vonderhaar
2021년 8월 6일
John D'Errico
2021년 8월 6일
While it may not have been explicitly homework, it is still surely a student project of some sort, that should arguably have been treated as homework.
And will you please stop titling EVERY question of yours with "I need some help please?"
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
