Convert seconds to hours/minutes

106 vues (au cours des 30 derniers jours)
Branislav Cerovski
Branislav Cerovski le 19 Avr 2020
Modifié(e) : Adam Danz le 20 Avr 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?

Réponse acceptée

Adam Danz
Adam Danz le 19 Avr 2020
Modifié(e) : Adam Danz le 20 Avr 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';

Plus de réponses (0)

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by