Why character or string array cannot be constructed like numerical array?
Afficher commentaires plus anciens
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 commentaires
KSSV
le 2 Avr 2020
Read about Cell. YOu can make cell of sting arrays.
Zeynab Mousavikhamene
le 2 Avr 2020
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!