When plotting datetime seconds are displayed as miliseconds

7 Ansichten (letzte 30 Tage)
Yuri Katz
Yuri Katz am 21 Feb. 2022
Kommentiert: Yuri Katz am 21 Feb. 2022
Hi
I have data in a time table, the datetime is formatted as MM/dd/yyyy HH:mm:SS. When plotting the data using plot (not stackedplot) it seems that the seconds are not displayed correctly (considered as milliseconds instead of seconds perhaps). Please see attached fig and zoom in. How can this be corrected.
Thanks

Akzeptierte Antwort

Stephen23
Stephen23 am 21 Feb. 2022
"How can this be corrected."
Use the correct format (possibly when importing the data, we do not know how you defined those datetime objects):
MM/dd/yyyy HH:mm:SS
% ^^ fractions of a second, what you used.
MM/dd/yyyy HH:mm:ss
% ^^ seconds, the correct format.

Weitere Antworten (0)

Kategorien

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

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by