Convert several columns char matrix into one column char matrix
Afficher commentaires plus anciens
I have a 200x12 matrix, with hours, minutes, seconds info. Each row has a time format like this: "13:35:43,050", but each column is composed of a single character of the time format ("1" in column 1; "3" in column 2; ":" in column 3, etc). I would like to end up with a 200x1 matrix, where all the column characters would appear in a single column, with no spaces. Can you help me, please? Thank you very much.
4 commentaires
Stephen23
le 4 Juil 2020
Convert the data to a datetime array:
madhan ravi
le 4 Juil 2020
And your expected result for the above example would be?
Cláudia Oliveira
le 4 Juil 2020
Cláudia Oliveira
le 6 Juil 2020
Réponses (1)
Sindar
le 4 Juil 2020
join?
>> tmp={'a' 'b' 'c' ; 'd' 'e' 'f'}
tmp = 2×3 cell
'a' 'b' 'c'
'd' 'e' 'f'
>> join(tmp,'')
ans = 2×1 cell
'abc'
'def'
Catégories
En savoir plus sur Data Type Conversion 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!