char array, cell array or string array
2 次查看(过去 30 天)
显示 更早的评论
How to padd numbers with leading zero or to convert to two digits in cell array, string array or char arrays?
5×16 char array
'2020-01-1-11-15'
'2020-02-5-12-5 '
'2020-04-25-10-30'
'2020-07-15-3-15 '
'2020-12-3-17-6 '
采纳的回答
Walter Roberson
2020-12-28
C = ['2020-01-1-11-15 '
'2020-02-5-12-5 '
'2020-04-25-10-30'
'2020-07-15-3-15 '
'2020-12-3-17-6 ']
char(datetime(cellstr(C), 'InputFormat', 'uuuu-M-d-H-m', 'Format', 'uuuu-MM-dd-HH-mm'))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geodesy and Mapping 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!