Errors when using fminbnd function
Ältere Kommentare anzeigen
Hi, I am trying to find use the fminbnd function to find the minimum and maximum values of a function.
I am getting these errors when I try and use the fminbnd function in my code:
Error using fcnchk (line 106): FUN must be a function, a valid character vector expression, or an inline function object
and
Error in fminbnd (line 194): funfcn = fcnchk(funfcn,length(varagin));
Here is my code
x=-10:.0001:10
f = (2+(x-1.45).^2)./(3+3.5.*(.8.*x.^2-.6.*x+2))
minusf=-1.*f
[xmin,y]=fminbnd(f,-10,10) *(THIS IS THE LINE THAT THE ERROR APPEARS AT)*
[xmax,y2]=fminbnd(minusf,-10,10)
fmin=f(xmin)
fmax=f(xmax)
1 Kommentar
James Robinson
am 5 Dez. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Custom Software for Target Hardware finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!