How to select multilple months in a time series.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 6 de En. de 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 comentarios
Walter Roberson
el 6 de En. de 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.
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!