create an array contain no of string adding one by one
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I would like to create an array in such a way that suppose the first element is 'Hi', second element is 'I', third element is 'am' and so on e.g. array(1) = 'Hi' array(2) = 'I' array(3) = 'am' array(4) = 'ABCD'
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Nov. 2012
Bearbeitet: Walter Roberson
am 3 Nov. 2012
This is something that cannot be done in MATLAB. Azzi's answer shows the closest you can get, but for it instead of A(1) being 'Hi', instead A(1) would be {'Hi'} which is a cell array instead of a string. A{1} would be the string 'Hi' though.
array{1} = 'Hi'
array{2} = 'I'
array{3} = 'am'
array{4} = 'ABCD'
0 Kommentare
Weitere Antworten (2)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!