Altering Default MaxFunEvals
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Sean de Wolski
am 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 Kommentare
Sean de Wolski
am 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.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!