Put datetime scale in x-axis
Show older comments
Hey there. I need to to put datetime scale in x-axis. I attached the values in a xls file.
m3=[x1,x2,x3,x4];
startDate = datenum('10-2006');
endDate = datenum('11-2099');
xdate = linspace(startDate,endDate,373); %number of months
figure
bar(xdate,m3);
dateaxis('x','mm-yyyy','keeplimlits');
legend({'X1','X2','X3','X4'},'Location','Southeast');
Till now, I only got to put the datenum and only x1 appears. When I execute the code below, it runs (exception to datetime scale).
m3=[x1,x2,x3,x4];
figure
bar(m3);
legend({'X1','X2','X3','X4'},'Location','Southeast');
Is it possible to solve it? Thanks :-)
Accepted Answer
More Answers (0)
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!