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.

 Accepted Answer

Daniel Shub
Daniel Shub on 25 Mar 2012

0 votes

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 Comment

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

Sign in to comment.

More Answers (1)

What about
sign(f1-f2)

1 Comment

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

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!