Set a bin to count the data points for certain conditions

1 回表示 (過去 30 日間)
Laura
Laura 2013 年 7 月 17 日
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 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 7 月 17 日
This is not clear
Jos (10584)
Jos (10584) 2013 年 7 月 17 日
I suggest you give a (very) small example!
dist = [...]
dist1 = [...]
R = ...
etc.
ExpectedOutcome is: ...

サインインしてコメントする。

採用された回答

Sean de Wolski
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 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by