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!!
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!