When plotting datetime seconds are displayed as miliseconds

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

 採用された回答

Stephen23
Stephen23 2022 年 2 月 21 日

0 投票

"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.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

製品

リリース

R2020b

タグ

質問済み:

2022 年 2 月 21 日

コメント済み:

2022 年 2 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by