# Double sum of this formula

15 ビュー (過去 30 日間)
giometar 2019 年 6 月 21 日
コメント済み: giometar 2019 年 6 月 24 日
Hello
_{E_n}=\sum_{k=1}^{n}\left ( _{d_k} \sum_{l=0}^{1-k}_{K_l}*{sin^{2l}{b_n_-_1}}\right )
Values of K0 and b0 are known
Thanks

### 採用された回答

Shwetank Shrey 2019 年 6 月 21 日
Just verify once if this is the formula that you needed. You would have to define K, b and n beforehand.
symsum((d(k).*symsum((K(l)*((sin(b(n-1))).^(2.*l))),l,0,(1-k))),k,1,n)

#### 3 件のコメント

giometar 2019 年 6 月 21 日
Thanks but it doesn't work
For example I have three vectors d,K and b. They are (10x1). l take values from 0 to 9, k take values from 1 to 10. First element of K is K(0) and first element of b is b(0).
Shwetank Shrey 2019 年 6 月 24 日
d = randi([0 9], 10, 1);
K = randi([0 9], 10, 1);
b = randi([0 9], 10, 1);
n = 3;
sum_k = 0;
for k = 2 : n+1
sum_l = 0;
for l = 1 : 3-k % this was if you had 1-k which i guess is a typo. anyway add 2 to whatever this would otherwise be.
sum_l = sum_l + (K(l) .* (sin(b(n)).^(2.*l)));
end
sum_k = sum_k + (d(k) .* sum_l);
end
disp(sum_k);
giometar 2019 年 6 月 24 日
thank you very much
it shoud be k-1