How can I change column values from a matrix?

Hi, I have to add [column number - 1]*0.5 to each column from a matrix,
For example:
0 0 0 0 0
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
to
0 0.5 1.0 1.5 2.0
1 1.5 2.0 2.5 3.0
2 2.5 3.0 3.5 4.0
3 3.5 4.0 4.5 5.0
I have to do that for an imported 700x20 matrix that already exists, maybe using for function, but I don't know how.

 Respuesta aceptada

Matt J
Matt J el 5 de Oct. de 2020
yourMatrix+(0:19)*0.5

2 comentarios

thanks!!!
Matt J
Matt J el 6 de Oct. de 2020
You're quite welcome, but since it did work, please Accept-click the answer.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 5 de Oct. de 2020

Comentada:

el 6 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by