I need to write a function that receives a float as input which represents a timestamp in seconds since midnight. It need to return the time in HH:MM AM/PM format but rounded to the nearest 15 minute peroid

답변 (1개)

Shubham Gupta
Shubham Gupta 2019년 11월 14일
편집: Shubham Gupta 2019년 11월 14일

0 개 추천

Try:
function out = timeconv(t)
y = datestr(round(t/900)*900/(24*60*60),'HH:MM AM');
end

댓글 수: 1

Walter Roberson
Walter Roberson 2019년 11월 14일
Please do not do people's homework for them. Guiding them to a solution is good though.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

질문:

2019년 11월 14일

댓글:

2019년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by