fminsearch output size bigger than the variables to optimize?
3 次查看(过去 30 天)
显示 更早的评论
So I'm trying to optimize some variables in a function with fminsearch, the code i wrote looks like this:
[solution] = fminsearch(@(parameters)NRTL_FO(T,x1,y1,P,ABC_C1,ABC_C2,parameters),[10000 1000 0,2]);
The beginning of the function NRTL_FO looks like this:
function [obj] = NRTL_FO(T,x1,y1,P,ABC_C1,ABC_C2,parameters)
g12_g22 = parameters(1);
g21_g11 = parameters(2);
alpha = parameters(3);
...
...
so there are 3 parameters to optimize, but the result that i'm getting is this:
solution =
1.0e+03 *
2.1437 -0.7804 -0.0012 0.3405
Why am I getting a 1x4 size solution when the parameters that im optimizing are 3 ?
Hope you can help me, thanks.
0 个评论
采纳的回答
Torsten
2023-3-5
[10000 1000 0.2]
instead of
[10000 1000 0,2]
as the vector of initial conditions.
MATLAB is not Excel.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!