Convert seconds to hours/minutes

124 views (last 30 days)
I'm trying to plot some data from simulink with respect to minutes/hours instead of seconds in Matlab as formatted time, i.e. hrs.min.
I have t=15000 sec. simulation time in simulink. How do I convert it so that I'm able to plot with respect to time in hours/minutes?

Accepted Answer

Adam Danz
Adam Danz on 19 Apr 2020
Edited: Adam Danz on 20 Apr 2020
Convert the numeric representation of seconds to durations.
% x are you seconds values
s = seconds(x);
Change the duration format to hh:mm
s.Format = 'hh:mm';

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!