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.

답변 (2개)

Jos (10584)
Jos (10584) 2014년 7월 3일

1 개 추천

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

Neethu
Neethu 2014년 7월 3일
Thanks for your answer but my data points cannot be fitted by a straight line ,its the IV curve of a solar cell.
Jos (10584)
Jos (10584) 2014년 7월 4일
so, what model does fit your data? Perhaps you can also take a look at interp1 or zero to find the intersections.

댓글을 달려면 로그인하십시오.

Star Strider
Star Strider 2014년 7월 3일

1 개 추천

Without seeing your data I can only speculate, but using the interp1 function with the 'linear','extrap' options could do what you want.

카테고리

도움말 센터File Exchange에서 Descriptive Statistics and Insights에 대해 자세히 알아보기

질문:

2014년 7월 3일

댓글:

2014년 7월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by