How to join the char and num in one matrix

2 visualizaciones (últimos 30 días)
Innosens
Innosens el 31 de Oct. de 2012
i have data char and num , can i join both in one matrix.....
the data is
12:00 AM 26
12:30 AM 27
1:30 AM 28

Respuestas (1)

Walter Roberson
Walter Roberson el 31 de Oct. de 2012
No. A numeric array can hold numeric data only. A character array can hold character data only.
You can convert the numeric data into character data so that your array is all character, or you can use a cell array.
{'12:00 AM', 26; '12:30 AM', 27, '1:30 AM', 28}

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by