(Automatically) Finding the intersection point of two graphes in my plot
조회 수: 7 (최근 30일)
이전 댓글 표시
I have written a script to analyse vectors out of a .txt-file und displays them under certain criteria. The plot I get looks like this.

Now I am trying to find the coordinates of the intersection point between my plot and the right red line.
I don't have functions to describe the lines, only vectors containing the data points. Bot yvectors are plotted over the same xvector. I thought a simple for-loop would suffice but the problem is, that the needed y-value in both y-vectors has a differing location in the vector. So for example if the right value was located in yvector1(100) it would be located in yvalue2(70).
I hope i could somehow explain my problem in an understandable way. Every help is very much appreciated.
The kind of simple loop i tried looks like this:
for cnt=1:numel(xvector)
s1=yvector1(cnt);
s2=yvector2(cnt);
zz=abs(s1-s2);
if zz <= 0.005
fprintf('location at %1.2f kN and %1.2f mm\n\n',yvector1(cnt),xvector(cnt))
end
end
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!