フィルターのクリア

Select every night data from a timetable with 1 minutes time step

3 ビュー (過去 30 日間)
Jian Teng
Jian Teng 2018 年 6 月 19 日
コメント済み: Jian Teng 2018 年 6 月 20 日
I have a timetable that has 4 months of data. It has a 1 minute time step. I would like to select data for each night from 8PM to 5PM. How can I do it?

採用された回答

Walter Roberson
Walter Roberson 2018 年 6 月 20 日
Assuming that you mean 5 AM, and that you want 8 PM exactly but not 5 AM exactly, then:
rt = YourTable.Properties.RowTimes;
rth = hour(rt);
mask = rth >= 20 | rth < 5;
subTable = YourTable(mask,:);
If you do want 5:00 AM to be included then
rt = YourTable.Properties.RowTimes;
rth = hour(rt);
rtm = minute(rt);
mask = rth >= 20 | rth < 5 | (rth == 5 & rtm == 0);
subTable = YourTable(mask,:);
  1 件のコメント
Jian Teng
Jian Teng 2018 年 6 月 20 日
It works, thank you so much!!!!!!!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by