Effacer les filtres
Effacer les filtres

Set a bin to count the data points for certain conditions

1 vue (au cours des 30 derniers jours)
Laura
Laura le 17 Juil 2013
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 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 17 Juil 2013
This is not clear
Jos (10584)
Jos (10584) le 17 Juil 2013
I suggest you give a (very) small example!
dist = [...]
dist1 = [...]
R = ...
etc.
ExpectedOutcome is: ...

Connectez-vous pour commenter.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 17 Juil 2013
idx = (dist >= R) & (dist<=(R+dr)) & (dist1>=R1) & (dist1<=(R1+dr1)); %all that meet criteria
count == nnz(idx); %how many of these were true?

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by