Error using fminbnd function
Mostra commenti meno recenti
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 103
If FUN is a MATLAB object, it must have an feval method.
Error in ==> fminbnd at 183
funfcn = fcnchk(funfcn,length(varargin));
Error in ==> programme_test at 5
M2=-fminbnd(dfdx2,a,b);
What am I doing wrong ?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Calculus in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!