why fmincon returns different results every time

2 次查看(过去 30 天)
Hi fellows,
I am using fmincon to do the optimization problem. But every time I run it it gives me different result. Is there anyone who know what the reason could be?
Cheers

采纳的回答

Sean de Wolski
Sean de Wolski 2012-9-10
  • Do you have a rand() in there that makes your function non-deterministic?
  • Is your function non-deterministic in some other way?
  • Are you using the same starting point, x0?
  • Are you modifying the options at all?
The more details you can provide us with the better.
  1 个评论
SHWETA GUPTA
SHWETA GUPTA 2013-2-28
I don't have rand() in my code, starting point is same every time I run the code but still it gives me different result. Please help.

请先登录,再进行评论。

更多回答(1 个)

xueqi
xueqi 2012-9-11
Yeah I did have a rand()...This explains!

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by