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

조회 수: 2,109(최근 30일)
fan feng
fan feng 2015년 6월 8일
답변: geofo 2021년 12월 3일
I want to append a new element,say 'c', to A, how could I do?
I would appreciate if you could help me.

채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 8일
A{end+1} = c;
  댓글 수: 6
Pedro Miranda Pinheiro
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개)

geofo 2021년 12월 3일
>> 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!

Translated by