How to select multilple months in a time series.
2 ビュー (過去 30 日間)
古いコメントを表示
f = readtable('Sample data.xlsx')
Kindly help me with code to select January, February, March, April, November and December data as dry season months in a different sheet. Select the remaining months data as wet season in another sheet. Thanks.
0 件のコメント
回答 (1 件)
Walter Roberson
2022 年 1 月 6 日
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/855600/Sample%20data.xlsx';
f = readtable(filename);
[~, m, ~] = ymd(f.Time);
mask = ismember(m, [1:4 11:12]);
dry = f(mask,:);
wet = f(~mask,:);
dry(1:5,:)
wet(1:5,:)
2 件のコメント
Walter Roberson
2022 年 1 月 6 日
In my experience, people are more likely to want to group by season -- one dry season, one wet season, one dry season, and so on -- instead of wanting to bunch together all wet in one place, and all dry in another.
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!