Easy question converting numbers to hours

2 ビュー (過去 30 日間)
012786534
012786534 2016 年 9 月 1 日
編集済み: Azzi Abdelmalek 2016 年 9 月 1 日
Hi all, I know this should be easy, but how would you convert whole numbers into HH:MM format? Like say 1156 into 11:56 ? Thank you

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 9 月 1 日
編集済み: Azzi Abdelmalek 2016 年 9 月 1 日
datestr(datenum(sprintf('%04d',1156),'HHMM') ,'HH:MM')
Or
a=sprintf('%04d',1156)
a=sprintf('%s:%s',a(1:2),a(3:4))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by