如何在Matlab中设置fsolve最大迭代次数?

时间:2015-12-11 21:52:49

标签: matlab iteration

我遇到了fsolve的问题。我需要设置MaxFunEvals,但它现在不起作用。当我通过这个调用fsolve时:

[X,fval]= fsolve(@(Q) fkinf(L1,L2,L3,L4,P,Q), [0 0 0 0 0 0 0 0 0]);

我收到一条消息:

Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square 
systems; using Levenberg-Marquardt algorithm instead. 
  In fsolve at 285
  In fkin at 11 

一分钟后

Solver stopped prematurely.

fsolve stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 1800 (the default value).

如果我在调用fsolve之前尝试更改它,则此消息仍然存在:

optimoptions('fsolve','MaxFunEvals',100)

optimoptions('fsolve','MaxFunEvals',100,'Algorithm', 'levenberg-marquardt')

我得到了一个好结果,但计算时间太长了。我做错了什么?

谢谢

0 个答案:

没有答案