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.

 Risposta accettata

Daniel Shub
Daniel Shub il 25 Mar 2012

0 voti

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 Commento

duygu
duygu il 25 Mar 2012
Thank u very much, I see that it's not an easy job :((

Accedi per commentare.

Più risposte (1)

Daniel Shub
Daniel Shub il 25 Mar 2012
What about
sign(f1-f2)

1 Commento

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

Accedi per commentare.

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by