Borrar filtros
Borrar filtros

Trying to do a summation of matrices

1 visualización (últimos 30 días)
Omar
Omar el 3 de Feb. de 2014
Respondida: Walter Roberson el 3 de Feb. de 2014
I have 2 , 1x20 Matrices. Say,Matrix A and B are my 2 Matrices. What I would like to do is Sum of (A_i + A_i+1)*(B_i + B_i+1). Where A_i @ i=0 is the first term of matrix A and A_i+1 the term after that for all 20 terms. Same for B. How could I do that?

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Feb. de 2014
sum((A(1:end-1) + A(2:end)) .* (B(1:end-1) + B(2:end)))

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by