MATLAB: Using fminbnd to find the max value.

fminbndfunctionmax point

How can I find the max value between 0.5 – 5 using fminbnd?
m=.09
b=2.7
Eq1=@(x) b.*(x.^m)
% I try this but I get an error
Maxp=fminbnd(Eq1.*-1,0.5,5)

Best Answer

[Bestx, Maxp] = fminbnd(@(x) -Eq1(x), 0.5, 5)