How to select multilple months in a time series.
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 6 Gen 2022
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 Commenti
Walter Roberson
il 6 Gen 2022
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.
Vedere anche
Categorie
Scopri di più su Dates and Time in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!