fminsearch output size bigger than the variables to optimize?
2 views (last 30 days)
Show older comments
Miguel Gómez Rubio
on 5 Mar 2023
Commented: Miguel Gómez Rubio
on 5 Mar 2023
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 Comments
Accepted Answer
Torsten
on 5 Mar 2023
[10000 1000 0.2]
instead of
[10000 1000 0,2]
as the vector of initial conditions.
MATLAB is not Excel.
More Answers (0)
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!