Convert Cell Arrays to Doubles
Show older comments
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.
Accepted Answer
More Answers (2)
Walter Roberson
on 14 Oct 2015
0 votes
You will need to use datetime objects or duration objects, which were introduced in R2014b.
Jan
on 14 Oct 2015
C = {'12:35' '11:35'
'14:21' '11:01'}
D = datenum(C, 'HH:MM')
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!