필터 지우기
필터 지우기

How to solve the double summation of the given expression

조회 수: 6 (최근 30일)
vivek raja
vivek raja 2017년 8월 24일
댓글: Yago Moreno 2019년 9월 5일
I am unable to find out how can we find the double summation of the expression which has a lot of variables in it
  댓글 수: 1
Jan
Jan 2017년 8월 24일
What have you tried so far? I would not call this "a lot of" variables, but as long as you do not explain their meaning, posting code is based on guessing only. Please provide any details.

댓글을 달려면 로그인하십시오.

답변 (1개)

njj1
njj1 2017년 8월 24일
편집: njj1 2017년 8월 24일
A blunt force method would be to have two for loops, one nested in the other. In the inner for loop, sum over the 'i' variables, and in the outer loop sum over the 'p' variables. This could look like:
AF = [];
for p=1:length(P)
for i=1:Np
AF = AF + I(p,i)*exp(1i*k*r(p)*sin(theta)*cos(phi0 - phi(p,i)) + alpha(p,i))
end
end
AF = 1 + AF;
A more elegant solution would use matrix operations.
  댓글 수: 1
Yago Moreno
Yago Moreno 2019년 9월 5일
Hi njj1,
I was wondering how you would use matrix operations for double sums. Could you give more details or re-direct me to another post? I have not found posts explaining this method.
Thanks!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by