Extract data from timetable for specific months
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Uswah Pawara
am 12 Okt. 2021
Kommentiert: Muhammad Uswah Pawara
am 12 Okt. 2021
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?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 12 Okt. 2021
Bearbeitet: Walter Roberson
am 12 Okt. 2021
[~, 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!