MATLAB Answers

fitting straight line to part of data and extrapolate to x-axis at y = zero

8 views (last 30 days)
please I want syntax to fit straight line on part of data points which lay on a straight in this graph (I point red circle on this data) , and then extraplotate to X-axis at y=zero in order to calculate X Value at Y=ZERO

Accepted Answer

Image Analyst
Image Analyst on 18 Jul 2021
If you don't know where the knee/kink/corner of your data is, then you can use a piecewise linear fit to fit the left and right portion to a line. The attached demo will figure out where that knee point is and give you the equation for each line.

Sign in to comment.

More Answers (1)

Matt J
Matt J on 18 Jul 2021
Edited: Matt J on 18 Jul 2021
p=polyfit( x(region),y(region) ,1);
xroot= roots(p) % the extrapolated root

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by