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.

 Réponse acceptée

Matt J
Matt J le 5 Oct 2020
yourMatrix+(0:19)*0.5

2 commentaires

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by