How to compute a summation of the following equation?
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to compute it dynamically. Please help me out with the code. Please find the attachment.... Thank you
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 8월 26일
pequiv = a * sum(rho .* h);
댓글 수: 2
Walter Roberson
2015년 8월 28일
Is there a reason why rho or h would not be length N?
If there is a reason why they are longer then use
pequiv = a * sum(rho(1:N) .* h(1:N));
You could put it all in a function if you really wanted, but it seems a bit simple:
pequiv = @(N,a,rho,h) a * sum(rho(1:N) .* h(1:N));
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!