Extract data from timetable for specific months
조회 수: 16 (최근 30일)
이전 댓글 표시
Muhammad Uswah Pawara
2021년 10월 12일
댓글: Muhammad Uswah Pawara
2021년 10월 12일
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
채택된 답변
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 Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!