How can I change elements in a matrix all at once??

How can I change each element in a matrix so that each new element is for example itself + the element next to it?

Respuestas (2)

Jan
Jan el 25 de Sept. de 2013
Editada: Jan el 25 de Sept. de 2013

0 votos

This seems to be a job for cumsum. A small example would clear the details.
[EDITED] After your comment: NO, not cumsum. See Kelly's answer.

1 comentario

Ken Mills
Ken Mills el 25 de Sept. de 2013
For example if I have mtx = [1 2 3; 4 5 6; 7 8 9] then the new element would be [3 5 3; 9 11 6; 15 17 9] Something like that.

Iniciar sesión para comentar.

Categorías

Preguntada:

el 25 de Sept. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by