Why character or string array cannot be constructed like numerical array?
Ältere Kommentare anzeigen
For eample:
a=[]; a(1:3)=1
but you cannot make string of character the same way:
a=[]; a(1:3)="er"
it returns:
a =
NaN NaN NaN
or
a=[]; a(1:3)='er'
returns this error:
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Any idea to make string or character array?
2 Kommentare
KSSV
am 2 Apr. 2020
Read about Cell. YOu can make cell of sting arrays.
Zeynab Mousavikhamene
am 2 Apr. 2020
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!