modify all numbers from same column in workspace

4 vues (au cours des 30 derniers jours)
MARIA ARISTA ROMERO
MARIA ARISTA ROMERO le 18 Sep 2020
Hi, I have a single column in the workspace and I need to add or rest the same value to all the numbers of the column, but I am not quite how to do it.
Example
1
2
3
1
2
add +1
results
2
3
4
2
3
Thanks!

Réponse acceptée

Arthur Roué
Arthur Roué le 18 Sep 2020
% Your vectecor
v = [1 2 3 1 2];
% Simply add 1 to your vector
v_plus_one = v + 1;
v_plus_one =
2 3 4 2 3
  1 commentaire
MARIA ARISTA ROMERO
MARIA ARISTA ROMERO le 18 Sep 2020
thanks a lot! that's exactly what I needed!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Encryption / Cryptography dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by