How to calculate intersection between the domains of two functions?

3 views (last 30 days)
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 Comments
Mr. 206
Mr. 206 on 8 Oct 2018
And is there a way to find out the common area between two graphs?
Torsten
Torsten on 8 Oct 2018
Edited: Torsten on 8 Oct 2018
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)

Sign in to comment.

Accepted Answer

KSSV
KSSV on 8 Oct 2018
Edited: KSSV on 8 Oct 2018
delta = max(g)-min(f)
I mean, the value of g at y maximum - the value of f at y minimum.
  8 Comments
KSSV
KSSV on 9 Oct 2018
Alternatively you can use InterX an file exchange function to get the intersection points.

Sign in to comment.

More Answers (0)

Categories

Find more on Signal Generation and Preprocessing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!