How to append a new element to a cell object A?
1.164 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
fan feng
el 8 de Jun. de 2015
Respondida: geofo
el 3 de Dic. de 2021
>>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 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Jun. de 2015
A{end+1} = c;
6 comentarios
Christopher Davis
el 10 de En. de 2021
That's really helpful, not sure if it's proper terminology but I've heard this refered to as prepend
Pedro Miranda Pinheiro
el 14 de Sept. de 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.
Más respuestas (1)
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!