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?

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 2일

1 개 추천

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

mayur
mayur 2013년 12월 2일
Thanks A lot man :) It will help my Final year Master project
Walter Roberson
Walter Roberson 2016년 7월 15일
ARUN MATHEW comments to Azzi:
it really helps

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2013년 12월 2일

댓글:

2016년 7월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by