(Automatically) Finding the intersection point of two graphes in my plot

157 次查看(过去 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

采纳的回答

KSSV
KSSV 2016-5-18

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by