Summation of an array
1 view (last 30 days)
Show older comments

How can i code this in matlab?
0 Comments
Accepted Answer
JESUS DAVID ARIZA ROYETH
on 5 Feb 2020
if length(P) and length(Y) is N:
x=sum(P.*Y)
in another case:
N=5; %set any value for N
x=sum(P(1:N).*Y(1:N))
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!