I am facing difficulties in plotting my time series data. I write code like this but doesnt work. data3=readtable ('PRICE_AND_DEMAND_Jan.csv') Date_Time = data3(:,2); datecell=table2cell(Date_Time); load = data3(:,3); A = table2array(load) p=datenum(datecell); plot(datenum(datecell), A) datetick('x', 'dd-mmm-yyyy HH:MM:SS') % datetick('x', 'dd-mmm-yyyy HH:MM:SS')
John Williams answered .
2025-11-20
try it:
data3=readtable ('PRICE_AND_DEMAND_Jan.csv')
Date_Time = data3(:,2);
datecell=table2cell(Date_Time);
load = data3(:,3);
A = table2array(load)
formatIn='dd-mm-yy HH:MM'
p=datenum(datecell,formatIn);
plot(p, A)
datetick('x', 'dd-mmm-yyyy HH:MM')
set(gca,'XTickLabel',datestr(p),'XMinorGrid','on')
grid