Hello,
I want to compute the max of a function on an interval [a,b].
For that I am using the function fminbnd as follows:
syms x;f=sqrt(3-2sqrt(x)); a=0; b=1;dfdx2=-abs(diff(f,2));dfdx4=-abs(diff(f,4));M2=-fminbnd(dfdx2,a,b);M4=-fminbnd(dfdx4,a,b);
The derivatives are calculated just fine but for M2, I get the following error message:
??? Error using ==> fcnchk at 103If FUN is a MATLAB object, it must have an feval method.Error in ==> fminbnd at 183funfcn = fcnchk(funfcn,length(varargin));Error in ==> programme_test at 5M2=-fminbnd(dfdx2,a,b);
What am I doing wrong ?
Best Answer