Easy question converting numbers to hours
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
012786534
am 1 Sep. 2016
Bearbeitet: Azzi Abdelmalek
am 1 Sep. 2016
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
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 1 Sep. 2016
Bearbeitet: Azzi Abdelmalek
am 1 Sep. 2016
datestr(datenum(sprintf('%04d',1156),'HHMM') ,'HH:MM')
Or
a=sprintf('%04d',1156)
a=sprintf('%s:%s',a(1:2),a(3:4))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!