How to query the date format when using dynamicDateTicks.m?

How can we query the date format when using dynamicDateTicks.m? The use case is dynamically displaying a corresponding date/time format in the axis label.

回答 (1 件)

Seth Furman
Seth Furman 2020 年 10 月 15 日

0 投票

See my recommendation to use datetime data when plotting, related to your other question, here:
If you use datetime data, you can easily query the datetime format from the axes using the following functions
For example,
>> plot(datetime('today'):caldays:30*caldays+datetime('today'),1:31)
>> xfmt = xtickformat
xfmt =
'MMM dd'

カテゴリ

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

製品

タグ

質問済み:

2020 年 10 月 12 日

回答済み:

2020 年 10 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by