Summation using for-loop

Hi Everyone, I want to ask a question about summation using for-loops. My question is similar to this previous questions. http://www.mathworks.com/matlabcentral/answers/23155-summation-with-looping
However, there are some differences in my case. I am struggling how to present this equation on Matlab. (attached photo)
Here is my code:
for M=1:a;
for R=1:a;
[M]=(K1*(conj(K2)))\(P^2) ;
[R]=(K1*(conj(K2)))\(P^2);
[B]= atan2(imag(M) ,real(R ));
sum(B);
end
end
This is one part of an function and Matlab debug gave me an error "Not enough input arguments." at the line "for M=1:a". Is the matrix unmatched? Besides, is the for-loop correct and enough to represent the equation? How should I change my code, please?
Thank you!!

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 7 May 2015

Edited:

on 7 May 2015

Community Treasure Hunt

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

Start Hunting!