Summation of an array

3 visualizzazioni (ultimi 30 giorni)
Barry Allen
Barry Allen il 5 Feb 2020
Commentato: Barry Allen il 6 Feb 2020
How can i code this in matlab?

Risposta accettata

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH il 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))

Più risposte (0)

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by