Call specific rows of a table then choose rows that has specific criteria in those rows .
조회 수: 1 (최근 30일)
이전 댓글 표시
![Capture.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236465/Capture.jpeg)
I want to say for each radius celltracker_group2.time == 10 if radius<=3 and cell_type==4 then GroupCount=GroupCoutn+1.
Any help?
댓글 수: 0
채택된 답변
Guillaume
2019년 8월 30일
I want to say for each radius celltracker_group2.time == 10 if radius<=3 and cell_type==4 then GroupCount=GroupCoutn+1
Easily done:
selectedrows = celltracker_group2.time == 10 & celltracker_group2.radius <= 3 & celltracker_group2.celltype == 4; %logical vector indicating which rows match the condition
celltracker_group2.GroupCount(selectedrows) = celltracker_group2.GroupCount(selectedrows) + 1; %add 1 to groupcount of the rows that match the condition
댓글 수: 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!