Summation of an array

3 Ansichten (letzte 30 Tage)
Barry Allen
Barry Allen am 5 Feb. 2020
Kommentiert: Barry Allen am 6 Feb. 2020
How can i code this in matlab?

Akzeptierte Antwort

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH am 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))
  1 Kommentar
Barry Allen
Barry Allen am 6 Feb. 2020
What if N is different?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by