Minimum and Maximum value of fitted curve
Show older comments
I am trying to find the minimum and maximum value of fitted curve. I will use the min and max point in another calculation. I used 'poly4' fit and its gives 4th order polynomial function. I tried polyder but couldnt go further. How can find the maximum and minimum point of fitted curve?
Accepted Answer
More Answers (2)
p = polyfit(x,y,4);
dp=polyder(p);
ddp=polyder(dp);
r=roots(dp);
r=r(abs(imag(r) ) < 1e-6);
maxima=r(polyval(ddp,r))<=1e-6 )
minima=r(polyval(ddp,r))>=1e-6 )
Extrema at the boundaries are not accounted for.
Nipun
on 20 Dec 2022
0 votes
Use the curve of best fit to find the maximum and minimum flow rates separately during the inflow and the outflow
Categories
Find more on Interpolation 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!