(Automatically) Finding the intersection point of two graphes in my plot
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Marco Kapfenberger
am 18 Mai 2016
Kommentiert: Marco Kapfenberger
am 18 Mai 2016
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Scatter Plots 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!