How to find intersection point of two curves, when the intersection point is not there in data sets?

조회 수: 2 (최근 30일)
Hi,
I have two curves like as shown in the picture.
Capture1.PNG
neither of x and y coordinates of the intersection point are not there in the data sets of the two curves. But finding exact intersection point is essential for me, since Im gonna use this data in 1d looup tables where it is showing that breakpoints should increase monotonically. So, in brief the blue curve should immediately start after the intersection point, I want to exactly remove data of red and blue curves after intersection point. Is there any possibility doing that?
Thanks in advance

채택된 답변

dpb
dpb 2019년 4월 14일
Both intersection sections appear to be straight lines; fit them and use fzero to find the point
bblue=polyfit(xblue,yblue,1); % fit the LH section of blue curve
bred=polyfit(xbred,yred,1); % fit the red curve
x0=fzero(@(x) polyval(bblue(x)-polyval(bred(x))),xred(1)); % find intersection
NB: I typed fzero line by memory in editor; check the documentation for exact syntax if it doesn't work as written
  댓글 수: 3
dpb
dpb 2019년 4월 14일
편집: dpb 2019년 4월 14일
Well, fit any functional that works--for no more curvature than shown there, a quadratic would likely be very close fit (I'd guess the linear would still be quite adequate, but you can test).
What's left to explain? Use fzero to find the X where the two lines cross (their difference is zero).
Or, if you have a functional form that is generating them and not just data points, then use the two exact functionals.
You've not given us any specifics to work from for more details...the data or the functional form of the lines would be the most helpful thing to post/attach.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by