How to calculate intersection between the domains of two functions?

조회 수: 3 (최근 30일)
Mr. 206
Mr. 206 2018년 10월 8일
댓글: Mr. 206 2018년 10월 9일
I have two column vectors (f and g). From this two vector how can i calculate the Delta (in picture).
The picture is just an example, I need an universal way to calculate the Delta.
  댓글 수: 8
Mr. 206
Mr. 206 2018년 10월 8일
And is there a way to find out the common area between two graphs?
Torsten
Torsten 2018년 10월 8일
편집: Torsten 2018년 10월 8일
If x_f and x_g are connected, this should work for the general case:
delta = max(min(max(x_f),max(x_g)) - max(min(x_f),min(x_g)),0)

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

채택된 답변

KSSV
KSSV 2018년 10월 8일
편집: KSSV 2018년 10월 8일
delta = max(g)-min(f)
I mean, the value of g at y maximum - the value of f at y minimum.
  댓글 수: 8
KSSV
KSSV 2018년 10월 9일
Alternatively you can use InterX an file exchange function to get the intersection points.
Mr. 206
Mr. 206 2018년 10월 9일
Can you please explain your code?

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

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by