I need some help with Curve Fitting
Show older comments
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 Comments
Star Strider
on 6 Aug 2021
This sounds suspiciously like homework!
See the relevant function documentation for examples on how to do all of this.
.
Daniel Vonderhaar
on 6 Aug 2021
John D'Errico
on 6 Aug 2021
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?"
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!