필터 지우기
필터 지우기

Easy question converting numbers to hours

조회 수: 1 (최근 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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by