MATLAB: Plotting precip and time data

precipitationtimetime series

Hi There, This is going to come across as a very simple question but i want to plot time on the x-axis in 'yyyy/mm/dd' format and precipitation on the y axis. I'm reading files from an excel data sheet but when i plot it using attached code, the x-axis looks weird. I know it has to do with the formatting but i'm not sure what… Any help is much appreciated! Thanks, Natasha
prcp_hope = xlsread('NCEI_CDO.xlsx','Hope','G:G'); prcp_hope(prcp_hope == -9999) = NaN;
datem_hope = xlsread('NCEI_CDO.xlsx','Hope','F:F');
plot(datem_hope,prcp_hope)

Best Answer

You check your file's date for the row number 29 and 620..it is not correct. I think it should be corrected. Try the code with attached file.
Related Question