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.

 채택된 답변

Daniel Shub
Daniel Shub 2012년 3월 25일

0 개 추천

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

duygu
duygu 2012년 3월 25일
Thank u very much, I see that it's not an easy job :((

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

추가 답변 (1개)

Daniel Shub
Daniel Shub 2012년 3월 25일

0 개 추천

What about
sign(f1-f2)

댓글 수: 1

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

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2012년 3월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by