Extracting certain months from an array
조회 수: 3 (최근 30일)
이전 댓글 표시
Hey. I have some 40x60x157800 arrays. 40x60 is values from measurements. 157800 measurements for every hours through 17 years. I have another array with datetime, and wants the months 5,6 and 7 in a different array. I have tried this:
summermonths = A(:,:,month(dates)==5);
But then I only get one month at the time. How can I do?
댓글 수: 0
답변 (1개)
KSSV
2018년 3월 14일
Read about datevec. This splits your dates into years, months, days and time. From this you can get the index of the months you want.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!