How to append a new element to a cell object A?
1,148 ビュー (過去 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!