minimum of two functions

Hi all, I need to find minimum of two functions for instance f1(x) = x+1, f2(x)= x+2 , min{f1, f2} = f1. It may not happen in general, actually I want which function is greater on which intervalon [0, infty): f1(x) = x^2, f2(x)=x+1 , min{f1, f2} = f2 on [0,1] , f1 on [1, infty). Thanx in advance. d.

 Akzeptierte Antwort

Daniel Shub
Daniel Shub am 25 Mär. 2012

0 Stimmen

At this point I don't think you have a MATLAB question ...
The possible boundary edges are when f1-f2 is zero (you can find these with solve). You need to check the derivative (and possibly the second derivative) to assure that it is a boundary (the diff function will help with that). You also need to keep track of the intervals to know where you are.

1 Kommentar

duygu
duygu am 25 Mär. 2012
Thank u very much, I see that it's not an easy job :((

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Daniel Shub
Daniel Shub am 25 Mär. 2012

0 Stimmen

What about
sign(f1-f2)

1 Kommentar

duygu
duygu am 25 Mär. 2012
I checked sign function , it's for arrays. Can you suggest me a way to use sign on functions?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by