Summation of an array

1 visualización (últimos 30 días)
Barry Allen
Barry Allen el 5 de Feb. de 2020
Comentada: Barry Allen el 6 de Feb. de 2020
How can i code this in matlab?

Respuesta aceptada

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 5 de Feb. de 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 comentario
Barry Allen
Barry Allen el 6 de Feb. de 2020
What if N is different?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by