Convert seconds to hours/minutes

조회 수: 89 (최근 30일)
Branislav Cerovski
Branislav Cerovski 2020년 4월 19일
편집: Adam Danz 2020년 4월 20일
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?

채택된 답변

Adam Danz
Adam Danz 2020년 4월 19일
편집: Adam Danz 2020년 4월 20일
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';

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by