Set a bin to count the data points for certain conditions
1 次查看(过去 30 天)
显示 更早的评论
Hi there,
I want to count the number of data values that are in this conditions
if it satisfies both conditions then count it
if dist>= R & dist<=(R+dr)
and
if dist1>= R1 & dist1<=(R1+dr1)
Please help.
2 个评论
Jos (10584)
2013-7-17
I suggest you give a (very) small example!
dist = [...]
dist1 = [...]
R = ...
etc.
ExpectedOutcome is: ...
采纳的回答
Sean de Wolski
2013-7-17
idx = (dist >= R) & (dist<=(R+dr)) & (dist1>=R1) & (dist1<=(R1+dr1)); %all that meet criteria
count == nnz(idx); %how many of these were true?
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Import, Export, and Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!