optimizing 2 parameters with fmincon
2 次查看(过去 30 天)
显示 更早的评论
I was optimizing a function named ML with fmincon to find the parameter "theta",
twostage = fmincon(@(theta)ML(theta,param,x,y),theta,[],[],[],[],lb,ub,[],options);
now I want to optimize another function ML2 for two parameters "theta1" and "theta2", can fmincon optimize a function for 2 parameters? how should I write the function?
Thanks
0 个评论
采纳的回答
Matt J
2012-11-30
编辑:Matt J
2012-11-30
Make theta a 2x1 vector instead and rewrite ML accordingly, to interpret theta as a 2x1 input vector. Also make ub and lb 2x1.
2 个评论
Matt J
2012-11-30
Yes, although once theta has been passed to ML, there's no reason you couldn't unpack as follows within the ML code:
theta1=theta(1);
theta2=theta(2);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Nonlinear Optimization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!