x and y intercepts
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
from a set of data points how can i find the x and y intercepts. These points are not amoung the data points so i can't use 'data cursor' tool here.
0 Kommentare
Antworten (2)
Jos (10584)
am 3 Jul. 2014
You want to fit a line to your x,y points and then solve the fitted line for y is zero and x is zero, giving you the x- and y-intercept. For instance, assuming your points are well-fitted by a straight line:
P = polyfit(X,Y,1)
Yintercept = P(2)
Xintercept = -P(2) / P(1)
For a higher-order polynomial fit, the Y intercept is still the last element of P, but finding the Xintercept (if it exists) is less straightforward.
2 Kommentare
Jos (10584)
am 4 Jul. 2014
so, what model does fit your data? Perhaps you can also take a look at interp1 or zero to find the intersections.
Star Strider
am 3 Jul. 2014
Without seeing your data I can only speculate, but using the interp1 function with the 'linear','extrap' options could do what you want.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!