fminsearch output size bigger than the variables to optimize?

조회 수: 4 (최근 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.

채택된 답변

Torsten
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 CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by