Extract data corresponding to particular dates
2 ビュー (過去 30 日間)
古いコメントを表示
I have csv file that contains a variable data every minute along with datetime in the format '2019-01-01 00:00'.
I want to select all data corresponding to particular dates say 12th Jan, 19th Jan, 24th March.
I imported the csv file using readtable and then converted it to timetable. However I am not sure how to select all data corresponding to particular dates. Every selected day should contain 24x60 data values.
0 件のコメント
採用された回答
Star Strider
2022 年 11 月 19 日
Therea re likely several ways to do this.
DT = table(datetime('now')+days(0:364).', 'VariableNames',{'DateTime'});
Data = array2table(randn(365,4));
T1 = [DT Data]
[y,m,d] = ymd(T1.DateTime);
query = [1 12; 1 19; 3 24];
Lv = ismember([m d], query, 'rows');
Result = T1(Lv,:)
.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!