Easy question converting numbers to hours

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

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 1 de Sept. de 2016
Editada: Azzi Abdelmalek el 1 de Sept. de 2016
datestr(datenum(sprintf('%04d',1156),'HHMM') ,'HH:MM')
Or
a=sprintf('%04d',1156)
a=sprintf('%s:%s',a(1:2),a(3:4))

Más respuestas (0)

Categorías

Más información sobre Electrical Block Libraries en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 1 de Sept. de 2016

Editada:

el 1 de Sept. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by