First, I have a function defined by cases like
if x<1 f(x)=xif x>1 f(x)=sqrt(x)
Second, suppose I want to calculate the maximium of f for 0<x<2 (this problem itself is trivial, but as an example).
Third, can one run fminsearch for such problem?
Best Answer