Including NaN on time series plot from xlsread MATLAB

28 Views Asked by At

I use xlsread to read a xlsx file

t = xlsread('CurrentA3.xlsx','Sheet1','A2:A5709');
mag = xlsread('CurrentA3.xlsx','Sheet1','B2:B5709');
dir = xlsread('CurrentA3.xlsx','Sheet1','C2:C5709');
u = xlsread('CurrentA3.xlsx','Sheet1','D2:D5709');
v = xlsread('CurrentA3.xlsx','Sheet1','E2:E5709');

The first 111 datas from the Excel file is NaN, and when I try to plot into time series it skipped the first 111 NaN datas and straight to the 112th data and so on. But all the NaN datas after that are includes in the plot. How do I fix that so the first 111 datas are also includes in the plot?

I already tried this

subplot(2, 1, 1);
plot(mag,'color','#00FA9A');
ylim([0 115])
set(gca,'YTick',([0 30 60 90 115]),'YTickLabel',{'0','30','60','90','115'});
xlim([0 5708]);
set(gca,'XTick',([1 687 1418 1980 2711 3441 4172 4902 5708]),...
    'XTickLabel',{'14/11/2000','01/10/2002','01/10/2004','01/10/2006','01/10/2008','01/10/2010','01/10/2012','01/10/2014','16/12/2016'});
grid on

and I expected the first 111 NaN datas was going to be included to the plot but it didn't.

0

There are 0 best solutions below