how to change multiple elements in a character array at once
显示 更早的评论
Letters = 'vegetables' Hi, I was trying to change the 5th element of the character arrays to the letter X and the last element to the letter Z in one short command. So the final answer will be : Letters = 'vegeXableZ' How can I do it?
采纳的回答
更多回答(1 个)
GK
2018-9-4
You can simply use,
Letters(5)='X';
Letters(end)='Z';
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!