fminsearch output size bigger than the variables to optimize?

3 ビュー (過去 30 日間)
Miguel Gómez Rubio
Miguel Gómez Rubio 2023 年 3 月 5 日
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.
  1 件のコメント
Miguel Gómez Rubio
Miguel Gómez Rubio 2023 年 3 月 5 日
that was definitely the problem, thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet 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