Convert seconds to hours/minutes

89 Ansichten (letzte 30 Tage)
Branislav Cerovski
Branislav Cerovski am 19 Apr. 2020
Bearbeitet: Adam Danz am 20 Apr. 2020
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?

Akzeptierte Antwort

Adam Danz
Adam Danz am 19 Apr. 2020
Bearbeitet: Adam Danz am 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';

Weitere Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by