Writing a Function Code
조회 수: 1 (최근 30일)
이전 댓글 표시
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
2019년 11월 14일
편집: Shubham Gupta
2019년 11월 14일
Try:
function out = timeconv(t)
y = datestr(round(t/900)*900/(24*60*60),'HH:MM AM');
end
댓글 수: 1
Walter Roberson
2019년 11월 14일
Please do not do people's homework for them. Guiding them to a solution is good though.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!