Convert Minutes to hours and minutes

4 views (last 30 days)
How to convert minutes to hours and minutes only?

Accepted Answer

Star Strider
Star Strider on 22 Mar 2015
See if this does what you want:
hr_min = @(mins) [fix(mins/60) rem(mins,60)]; % Minutes —> [Hrs Min]
mins = [0:15:1440]'; % Test Data
test = hr_min(mins) % Test Output
  8 Comments
Victor Seaw
Victor Seaw on 23 Mar 2015
meaning rem simply follow the +,- sign of the dividend while mod follow +,- of the divider?
Star Strider
Star Strider on 23 Mar 2015
That, and the behaviours where the divisor is zero.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!