Convert Cell Arrays to Doubles
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (2)
Walter Roberson
le 14 Oct 2015
0 votes
You will need to use datetime objects or duration objects, which were introduced in R2014b.
Jan
le 14 Oct 2015
C = {'12:35' '11:35'
'14:21' '11:01'}
D = datenum(C, 'HH:MM')
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!