Hey,
It is my understanding that you want to extract datapoints from a dataset based on the date-time information.
Here is a code snippet for your reference:
lowerTime_limit = datetime('28-Dec-2020 09:00:00');
upperTime_limit = datetime('28-Dec-2020 17:30:00');
time_Array = datetime(["28-Dec-2020 15:00:00", "28-Dec-2020 14:00:00", "28-Dec-2020 13:00:00", "28-Dec-2020 19:00:00"], 'InputFormat','dd-MMM-yyyy HH:mm:ss');
tf = isbetween(time_Array, lowerTime_limit, upperTime_limit)
If you want to extract all days withtin a particular time range, you can refer to the following code for a possible workaround:
lowerTime_limit = convtoMin(datetime('09:00:00'));
upperTime_limit = convtoMin(datetime('17:30:00'));
time_Array = datetime(["28-Dec-2020 15:00:00", "28-Dec-2020 14:00:00", "28-Dec-2020 13:00:00", "28-Dec-2020 17:31:00"], 'InputFormat','dd-MMM-yyyy HH:mm:ss');
tf = [convtoMin(time_Array) >= lowerTime_limit & convtoMin(time_Array) <= upperTime_limit]
function output = convtoMin(input)
output = input.Hour*60 + input.Minute;