Why isn't my max iterations increasing?

I'm trying to increase the max iterations for fsolve but it seems that it's not changing even when I specify a different number.

 Accepted Answer

Always tell the functions that there is an options structure available —
answer1 = fsolve(fun, x0, options)
They do not infer it from its presence in your workspace.

More Answers (2)

Evidently it has a max iteration of 400, not ten thousand like you tried to use. I don't know why.
You're not passing the options you set using optimoptions into fsolve. The optimoptions function doesn't change some "global options"; you have to pass that output argument into the function you want to use the new options.

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!