How to append a new element to a cell object A?
1,178 次查看(过去 30 天)
显示 更早的评论
>>A={'a';'b'};
I want to append a new element,say 'c', to A, how could I do?
I would appreciate if you could help me.
0 个评论
采纳的回答
Walter Roberson
2015-6-8
A{end+1} = c;
6 个评论
Christopher Davis
2021-1-10
That's really helpful, not sure if it's proper terminology but I've heard this refered to as prepend
Pedro Miranda Pinheiro
2021-9-14
Thank you, @Walter Roberson! @Christopher Davis, prepend is used for insertion of an element in the begining of a data structure. Append is the one used for end insertion as mentioned above.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!