Working and non Working hours

3 ビュー (過去 30 日間)
Tushar Agarwal
Tushar Agarwal 2016 年 10 月 3 日
コメント済み: Tushar Agarwal 2016 年 10 月 6 日
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?

採用された回答

Jan Orwat
Jan Orwat 2016 年 10 月 3 日
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 件のコメント
Steven Lord
Steven Lord 2016 年 10 月 5 日
Use the day function with the 'dayofweek' option.
Tushar Agarwal
Tushar Agarwal 2016 年 10 月 6 日
Thanks guys.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by