Altering Default MaxFunEvals
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I'm having trouble altering the default number of evaluations (300) of an fsolve. My .m file looks like this (function omitted):
function solveeqs()
guess=[1.6 0 300];
options = optimset('MaxFunEvals',1e10);
[result, fval, exit, output]=fsolve(@eqns, guess);
result
fval
eqns(guess)
exit
output
end
I thought that the options command might fix it, but the output defines the evaluation limit at 300 anyways. Any tips?
0 Commenti
Risposte (1)
Sean de Wolski
il 2 Feb 2012
You're not passing the options structure to fsolve()
options = optimset('MaxFunEvals',1e10);
[result, fval, exit, output]=fsolve(@eqns, guess,options);
Just make sure options is defined before you call fsolve.
3 Commenti
Sean de Wolski
il 2 Feb 2012
The default maxfunevals is 100 times the number of variables. Can you post _exactly_ what you are running?
I would worry a little that there is something more seriously wrong if it has not converged after that nmany iterations.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!