Altering Default MaxFunEvals
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Sean de Wolski
2012 年 2 月 2 日
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 件のコメント
Sean de Wolski
2012 年 2 月 2 日
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.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!