Convert seconds to hours/minutes

123 visualizaciones (últimos 30 días)
Branislav Cerovski
Branislav Cerovski el 19 de Abr. de 2020
Editada: Adam Danz el 20 de Abr. de 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?

Respuesta aceptada

Adam Danz
Adam Danz el 19 de Abr. de 2020
Editada: Adam Danz el 20 de Abr. de 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';

Más respuestas (0)

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by