Convert seconds to hours/minutes

130 visualizzazioni (ultimi 30 giorni)
Branislav Cerovski
Branislav Cerovski il 19 Apr 2020
Modificato: Adam Danz il 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?

Risposta accettata

Adam Danz
Adam Danz il 19 Apr 2020
Modificato: Adam Danz il 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';

Più risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by