How to use dates as x axis?

11 views (last 30 days)
Giuseppe Marzano
Giuseppe Marzano on 1 Nov 2017
Edited: KL on 1 Nov 2017
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.

Answers (1)

KL
KL on 1 Nov 2017
Edited: KL on 1 Nov 2017
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:

Tags

Community Treasure Hunt

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

Start Hunting!