Double Summation Obective Function

10 ビュー (過去 30 日間)
Daniel John
Daniel John 2015 年 5 月 29 日
コメント済み: Nelson 2015 年 8 月 19 日
How can I optimize (e.g. using fmincon) when the objective function is in double summation form? For example, f=sum(sum(Nij)) for i=1..S and j=1..K?

採用された回答

Torsten
Torsten 2015 年 5 月 29 日
f=0.0;
for i=1:S
for j=1:K
f=f+N(i,j);
end
end
Best wishes
Torsten.
  1 件のコメント
Nelson
Nelson 2015 年 8 月 19 日
Hi Torsten,
I have a quite similar problem cause I need to minimize the sum of square of a matrix (M) that is funcion of my variable vector x. I can use the meansqr(M) as my objective function as:
y = meansqr(M);
is it the same for Matlab or does it need a symbolic expression? Looking at your example I would say no.
Suppose that y = meansqr(M) is correct. Can I define gradients using symbolic expressions and therefore including my variables (x(1),x(2) etc.)?
With such implementation the code runs, but I would like to know if it is correct.
Thanks
Regards,
N.

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

その他の回答 (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