Summation of an array
2 views (last 30 days)
Show older comments
Barry Allen
on 5 Feb 2020
Commented: Barry Allen
on 6 Feb 2020
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
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!