MATLAB: How to get the no of default ticks formed in to the code when plotting a figure in matlab

datenumtimetime seriesxlabelsxticks

I am plotting the data vs time. I am using the datenum function to convert the time in to values and plotting the graphs for now. And then I want to change the X labels from datenum values to actual time. But for that I have to know the no of ticks formed.

Best Answer

You can actually just use the datetick function:
dFormat = 'mmm-yyyy'; % or whatever date format you want
datetick('x',dFormat)