modify all numbers from same column in workspace
2 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!