MATLAB: How to plot part of Date column vs Data

data analysisdata plotdate vs dataimporting data from fileMATLABplotting data vs timetime plottime vs data

I have a date column staring from '31-Jul-2013 10:59:50' and ends on '04-May-2015 12:45:10'. the total no of. rows are 5547430(that means the data is collected for every 10 secs). I have another column of equal size of date column. Now I want to plot the collected Data in specific period of time. For example I want to plot the data in June 2014 or May 2015 or January 1st 2014. How to extract the content from data corresponding to specific date or time.

Best Answer

In R2014b or later, try this:
d = ( datetime('31-Jul-2013 10:59:50'):seconds(10):datetime('04-May-2015 12:45:10') )';
x = cumsum(randn(size(d)));
isJun2014 = isbetween(d,'1-Jun-2014','1-Jul-2014');
plot(d(isJun2014),x(isJun2014))