How to append a new element to a cell object A?

2,009 views (last 30 days)
I want to append a new element,say 'c', to A, how could I do?
I would appreciate if you could help me.

Accepted Answer

Walter Roberson
Walter Roberson on 8 Jun 2015
A{end+1} = c;
Pedro Miranda Pinheiro
Pedro Miranda Pinheiro on 14 Sep 2021
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.

Sign in to comment.

More Answers (1)

geofo on 3 Dec 2021
>> A=[A;'c'];


Find more on Data Type Identification in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!