Involve fminbnd in optimoptions
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sudhir Kumar
am 30 Okt. 2021
Kommentiert: Sudhir Kumar
am 31 Okt. 2021
I want to minimize a function f: which has a single variable θ. I want to minimize the function so I want to use the command "fminbnd". Although I want to see the iteration display through "optimoptions". If I write a chunk of code like this
fun = @(theta) optimum_theta(alpha,snr_db(isnrdb),t_min,t_max,m,theta);
options = optimoptions('fminbnd','Display','iter'); % show iterations
[x fval exitflag output] = fminbnd(fun,lower_bound,upper_bound,options);
Here the chunk of code I am not getting how to proceed
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 30 Okt. 2021
Bearbeitet: John D'Errico
am 30 Okt. 2021
Note that fminbnd is not provided as part of the optimization toolbox. As well, fminbnd has been around a long time. So optimoptions does not support fminbnd. (I suppose there are good arguments as to why it should. But it apparently does not.)
Use optimset instead.
fun = @(x) (x-pi).^2; % not very creative
opts = optimset('fminbnd');
opts.Display = 'iter';
[x fval exitflag output] = fminbnd(fun,0,10,opts)
Note: you would have learned that quickly had you read the docs for fminbnd, where you would see that it uses optimset.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!