Convert Cell Arrays to Doubles
Mostrar comentarios más antiguos
How can I convert a cell array of times:
C = {'12:35' '11:35'
'14:21' '11:01'}
to an array of doubles
B = 12:35 11:35
14:21 11:01
where I can do mathematical operations with it if given a certain amount of minutes.
For example, 12:35 + 60 minutes = 13:35.
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 14 de Oct. de 2015
0 votos
You will need to use datetime objects or duration objects, which were introduced in R2014b.
Jan
el 14 de Oct. de 2015
C = {'12:35' '11:35'
'14:21' '11:01'}
D = datenum(C, 'HH:MM')
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!