How to use dates as x axis?

Good morning or afternoon to everyone. I've already searched a lot about this but I were not able to fix it, maybe I do not follow all the steps. I need to make a plot of different time series, where the x axis should be the time range, from january 2007 to august 2016. The dates are collected on a .xlsx file, and they are of the format dd/mm/yyyy. How can I use them as "values" of the x axis? Using xlsread they are uploaded as cell. I would really appreciate the help of who is going to answer me.

回答 (1 件)

KL
KL 2017 年 11 月 1 日
編集済み: KL 2017 年 11 月 1 日

0 投票

You could use them as xticklabels and use the datestr of your datetime values.
There are also more easier possibilities like datetick. For example,#
plot(dateTimeVec,Measurements)
datetick('x','mmmyyyy')
Check these links:

カテゴリ

ヘルプ センター および File ExchangeTime Series Objects についてさらに検索

タグ

質問済み:

2017 年 11 月 1 日

編集済み:

KL
2017 年 11 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by