Double Summation For two point correlation

조회 수: 1 (최근 30일)
Nicole Konforti
Nicole Konforti 2017년 3월 3일
답변: Darshan Ramakant Bhat 2017년 3월 6일
I have to use the double summation function (attached below) where the phi function is the distance formula in three dimensional space. I have the function I need, but I am not sure how to program it into a double summation on MATLAB.
  댓글 수: 1
Alexandra Harkai
Alexandra Harkai 2017년 3월 3일
What have you tried so far? What are D and R? What arguments does your phi function take?

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

답변 (1개)

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2017년 3월 6일
I think the simpler way is to do using two for loops.
d_sum=0;
for i=1:length(D)
x=D(i);
for j=1:length(R)
y=R(j);
d_sum=d_sum+fi_fun(x,y);
end
end
Additionally you can try to vectorize the process. Following link may help you
Regards,
Darshan Bhat

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by