how to compare two graphs in matlab?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
mayur
am 2 Dez. 2013
Kommentiert: Walter Roberson
am 15 Jul. 2016
I draw two graphs using plot function in matlab. I want to compare if any cut of two graphs occurs in a picture. How to perform this operation?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 2 Dez. 2013
If data are available, just compare your data, y1==y2 will not work. Try to find when y1-y2 is changing sign
Example
t=0:0.1:10;
y1=sin(t);
y2=cos(t);
plot(t,y1,t,y2);
a=sign(y1-y2);
ii=sort([strfind(a,[-1,1]),strfind(a,[1,-1])])
t(ii)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!