How can I select or extract rows?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a 9855 * 1 table indicating months.
Such as
1
1
1
2
2
2
3
3
3
. .
12
12
12
1
1
1
2
2
2
...
How can I select or extract June to August?
댓글 수: 0
채택된 답변
Star Strider
2022년 9월 6일
It depends on what the data are (for example, datetime arrays).
Given the problem described —
Months = repmat(ones(3,1) * (1:12), 1, 5);
Data = [Months(:) (1:numel(Months)).']
% Check1 = Data(24:36,:)
Result = Data(6 <= Data(:,1) & Data(:,1) <= 8, :)
Check2 = Result(28:36,:)
There are other approaches as well. this is likely the simplest.
.
댓글 수: 0
추가 답변 (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!