modify all numbers from same column in workspace

조회 수: 3 (최근 30일)
MARIA ARISTA ROMERO
MARIA ARISTA ROMERO 2020년 9월 18일
댓글: MARIA ARISTA ROMERO 2020년 9월 18일
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!

채택된 답변

Arthur Roué
Arthur Roué 2020년 9월 18일
% 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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by