필터 지우기
필터 지우기

Writing a Function Code

조회 수: 1 (최근 30일)
Lauren Kinchla
Lauren Kinchla 2019년 11월 14일
댓글: Walter Roberson 2019년 11월 14일
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
Walter Roberson
Walter Roberson 2019년 11월 14일
Okay, go ahead.

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

답변 (1개)

Shubham Gupta
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
Walter Roberson 2019년 11월 14일
Please do not do people's homework for them. Guiding them to a solution is good though.

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by