Filter table data into matrix

조회 수: 1 (최근 30일)
Annymm
Annymm 2020년 10월 1일
답변: Eric Sofen 2020년 10월 2일
I have rainfall amount data by month for seveeral years and different weather stations. I want to filter the data for May, June July into a new table. How can I do that? My table looks like this:
Date Georgetown Kamarang Lethem Mabaruma NewAmsterdam Timehri
1971-01 120 146.3000 195.6000 227.4000
1971-02 78.9000 82.8000 31.9000 68.8000
1971-03 80.2000 65.1000 15.3000 111.5000
1971-04 126.8000 173.2000 28.1000 178.3000
1971-05 374.6000 271 150.6000 411.3000
1971-06 401.2000 479.1000 505.3000
1971-07 296.6000 320.9000 317 243.5000
1971-08 347.7000 249.1000 227.8000 189.6000 348.4000
1971-09 108.4000 190.9000 104.9000 228.1000 123.1000

답변 (1개)

Eric Sofen
Eric Sofen 2020년 10월 2일
From your description, it sounds like you want data for MJJ for all years? Assuming your data is in a timetable and your dates are represented as datetime:
t(ismember(month(t.Date), [5:7]),:)

카테고리

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