How do I write a function that inputs seconds and outputs the number of days, hours, and mins?

38 views (last 30 days)
I'm confused in writing a function that can take seconds as an input and provides an output in the number of days, hours, minutes, and seconds, if applicable.

Answers (1)

Shanmukha Voggu
Shanmukha Voggu on 1 Oct 2021
Using Format property of the duration solves the issue
tim = duration
94255 sec
tim = duration
Refer this for more information about seconds function
Hope this helps!

Community Treasure Hunt

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

Start Hunting!