Extract data from timetable for specific months

18 次查看(过去 30 天)
Dear All
I have timetable data (tt). The table contains H with range 1950-2020, I want to extract H in the timetable.
how to extract data (H) for spesific months (January, February, and December) over the years?

采纳的回答

Walter Roberson
Walter Roberson 2021-10-12
编辑:Walter Roberson 2021-10-12
[~, mon, ~] = ymd(TT.t1);
mask = ismember(mon, [1 2 12]);
TTsubset = TT(mask,:);
Or if you were looking for specific months,
Jansubset = TT(mon == 1, :);
Febsubset = TT(mon == 2, :);
Decsubset = TT(mon == 12, :);
Remember that all the years run together in these, so the last entry for January 1950 would be followed immediately by the first entry for January 1951.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by