MATLAB: Return the names of people whose score was zero for range

MATLAB

Return the names of people whose score was 0 between 13:00 and 14:00
Name | Time | Score
------ | ------ | ------
Jon | 11:15 | 2.4
Jon | 13:00 | 0
Jon | 20:00 | 0
Frank | 6:00 | 4.7
Frank | 13:45 | 0
Frank | 17:45 | 3
Jack | 9:00 | 0
Jack | 13:30 | 7.2
Jack | 19:30 | 0
Out:
Name |
------ |
Jon |
Frank |

Best Answer

I would recommend using a datetime to treat time. Using datetime, solution for your problem will be like:
% Your data table
Name = {'Bill';'Bill';'Bill';'Steve';'Steve';'Steve';'Jack';'Jack';'Jack'};
Time = {'11:15';'13:00';'20:00';'6:00';'13:45';'17:45';'9:00';'13:30';'19:30'};
Score = [2.4;0;0;4.7;0;3;0;7.2;0];
T = table(Name,Time,Score);
% Convert T.Time to datetime
T.Time = datetime(T.Time,'InputFormat','HH:mm');
% Conditions
idx1 = (T.Time >= datetime('13:00','InputFormat','HH:mm')) &...
(T.Time <= datetime('14:00','InputFormat','HH:mm'));
idx2 = T.Score == 0;
% Extract the names satisfying the conditions
Result = T.Name(idx1 & idx2);