How to take input from a function file in optimization toolbox objective?

Hello All,
I have an objective function of type: Gexp - phi*inv(lambda)*phi'
Out of this objective function Gexp is constant and known while rest of the term is to be found out at every iteration. So how to link that term to a function file which will give output as phi and lamda? And how to define the variable in the same function file so that the algorithm will determine the new value of phi and lamda after every iteration by changed value of variable it found during every iteration?
Thank You.

 採用された回答

Torsten
Torsten 2019 年 4 月 8 日

0 投票

x = fmincon(@objective,x0,A,b)
function f = objective(x)
% Calculate phi and lambda from x
f = -phi*inv(lambda)*phi';
end

5 件のコメント

Bhushan Patil
Bhushan Patil 2019 年 4 月 8 日
Thank You
Bhushan Patil
Bhushan Patil 2019 年 4 月 16 日
Hey,
Sorry to bother you again but can you tell me how to include step size inside my function file?
Torsten
Torsten 2019 年 4 月 16 日
Step size ? Step size of what ?
Bhushan Patil
Bhushan Patil 2019 年 4 月 16 日
編集済み: Bhushan Patil 2019 年 4 月 16 日
Value by which variable has changed in an iteration.
I have 15 variables so by how much each of the values is changing, I have to include those values in my code.
Torsten
Torsten 2019 年 4 月 16 日
https://de.mathworks.com/help/optim/ug/output-functions.html

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProblem-Based Optimization Setup についてさらに検索

製品

リリース

R2018a

質問済み:

2019 年 4 月 8 日

コメント済み:

2019 年 4 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by