How to compute the frequency of hourly/daily observation?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I want to compuet the hourly/daily number of observations. My data consistes of six colums (YYYY MM DD HH MM SS). Each date-time entry show one observation.
The measurements are uneven i.e. 0 to 100 etc. From the data set presnted below: I am interested to calcualet the hourly observations from 2015-05-06-10-35-00 to 2015-05-08-22-35-00 and same for the daily observations. (data also attached in excel sheet).
Thank you!
0 件のコメント
採用された回答
Cris LaPierre
2021 年 2 月 15 日
Your spreadsheet is empty.
7 件のコメント
Cris LaPierre
2021 年 2 月 15 日
編集済み: Cris LaPierre
2021 年 2 月 17 日
You will have to create your groupbins manually rather than use 'day' and 'hour'. To get a result for each bin, use the 'IncludeEmptyGroups' and 'IncludeMissingGroups' options.
% Create groupbins for hourly and daily
startT = datetime(2016,12,05,13,35,00);
endT = datetime(2016,12,10,13,35,00);
newT_hr = startT:hours(1):endT;
newT_day = startT:caldays(1):endT;
% Count groups
hrAvg = groupsummary(data,"timestamp",newT_hr,"IncludeEmptyGroups",true,"IncludeMissingGroups",true)
dayAvg = groupsummary(data,"timestamp",newT_day,"IncludeEmptyGroups",true,"IncludeMissingGroups",true)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!