MATLAB: How to filter data by date

filtertimetable

I have a table where the first column contains the date and in the following ones are different variables related with this date. My question is how can I extract information from the table for every season? This means, to create several tables that filters only the observations related with spring 2010 (March to May), summer 2010 (June to August), autumn 2010 ( September to November) and winter 2010 (December 2010 to February 2011)?
I am new using matlab and what I did first is to convert the table to a timetable, but then I dont know how to make the date filter. My date is shown as day/month/year, for example, 26/01/2010.
Thanks in advance!
My data looks likes this:
Captura de pantalla 2020-01-13 a la(s) 1.32.38 p. m..png

Best Answer

Suppose your timetable data in the variable td
spring = td(timerange('2010-04-01', '2010-05-31'), :); % spring time data
summer = td(timerange('2010-06-01', '2010-08-31'), :); % summer time data
autumn = td(timerange('2010-09-01', '2010-10-31'), :); % autumn time data
winter = td(timerange('2010-12-01', '2011-02-28'), :); % winter time data