Why is this string considered length one?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Why is '15' a string of length one?
>> datestamp = '1991-6-15'
datestamp =
1991-6-15
>> a = textscan(datestamp,'%4s %2s %2s','Delimiter','-');
>> length(a{3})
ans =
1
>> a{3}
ans =
'15'
I'm trying to get the length of the string. Sometimes letters will be used, so converting to numbers is not an option.
Why is '15' a string of length one?
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion 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!