
Double sum with upper limits
3 ビュー (過去 30 日間)
表示 古いコメント
Hi
I am trying to do the following calululation in matlab:

But I do not how how to do the two sums in the front. Our data (d) is a 67x120 array.
Any suggestions would be appreciated :)
2 件のコメント
採用された回答
その他の回答 (1 件)
Luna
2020 年 3 月 2 日
Maybe something like that would help:
d = rand(67,120);
sum_of_cos_s = 0;
result = 0;
for s = 1:67
for j = 1:120
sum_of_cos_s = sum_of_cos_s+cos(s);
result = result + (d(s,j)*cos(s))/sum_of_cos_s;
end
end
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!