フィルターのクリア

Minimize a function with inequality constraint.

1 回表示 (過去 30 日間)
Imane hammou ouali
Imane hammou ouali 2021 年 6 月 10 日
コメント済み: Imane hammou ouali 2021 年 6 月 11 日
Hello community
Please, can you help me solving this problem.
I have a function to minimize.
F(t)=0.5( 0.7*P(t)+0.7*P(t+1) ) + 0.5*(t-1)^2
where
P is a vector; P=[0.3 0.4 0.2 0.7 0.1 0.6 0.3 0.1 ]
t is an integer variable that must be 1<= t <=5
I have to find the values of t
Thanks in advance.

採用された回答

Chunru
Chunru 2021 年 6 月 11 日
P=[0.3 0.4 0.2 0.7 0.1 0.6 0.3 0.1 ]; % Assuming these are P(1), P(2), ...
F = zeros(5,1);
for t=1:5
F(t)=0.5*(0.7*P(t)+0.7*P(t+1) ) + 0.5*(t-1)^2;
end
[Fmin, idx] = min(F);
figure;
plot(1:5, F, '-', idx, Fmin, 'ro' )
  1 件のコメント
Imane hammou ouali
Imane hammou ouali 2021 年 6 月 11 日
Thank you so much

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by