Convert Cell Arrays to Doubles
古いコメントを表示
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.
採用された回答
その他の回答 (2 件)
Walter Roberson
2015 年 10 月 14 日
0 投票
You will need to use datetime objects or duration objects, which were introduced in R2014b.
Jan
2015 年 10 月 14 日
C = {'12:35' '11:35'
'14:21' '11:01'}
D = datenum(C, 'HH:MM')
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!