Call specific rows of a table then choose rows that has specific criteria in those rows .
1 次查看(过去 30 天)
显示 更早的评论
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 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!