Working and non Working hours
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tushar Agarwal
le 3 Oct 2016
Commenté : Tushar Agarwal
le 6 Oct 2016
Is there a way in which I can split my data with one column having datetime (day and hour) into working and non working hours?
0 commentaires
Réponse acceptée
Jan Orwat
le 3 Oct 2016
Yes, you can. For example:
% assuming your data in variable called datecolumn
daytime = timeofday(datecolumn);
openinghour = duration(09, 00, 00);
closinghour = duration(18, 00, 00);
isworkinghour = (openinghour <= daytime) & (daytime <= closinghour);
workinghours = datecolumn(isworkinghour);
nonworkinghours = datecolumn(~isworkinghour);
8 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numeric Types dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
