Dealing with character array
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yongmin
am 26 Dez. 2014
Kommentiert: Star Strider
am 26 Dez. 2014
Hello!
I have a character array, for example, A (m x n). In this array, each character is an element of m x n matrix.
However, I want to deal with this array as m row vectors of n elements each, i.e. m strings of n characters. How can I access the row vector instead of using A(1,:)? I'd like to know what kind of data type can be used to access a string of characters?
Many thanks!
0 Kommentare
Akzeptierte Antwort
Star Strider
am 26 Dez. 2014
A = ['a' 'b' 'c'; 'd' 'e' 'f'; 'g' 'h' 'i'];
C = cellstr(A);
C1 = C{1}
2 Kommentare
Weitere Antworten (0)
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!