MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Count


On 5 Apr 2004, at 18:23, paolo wrote:

> if i have a time serie, how can i Count the elements of this time 
> serie that are within a defined range
> Example:
>
> x={1,1.023,1.056,2.45,5.67,....}
>
> how can i Count the elements inside the range (1,3)?
>
> thanks
>
> Paolo
>
>
Here are a couple of a number of  possible ways:


Count[{1,1.023,1.056,2.45,5.67},_?(1²#²3&)]


4

or

Count[{1,1.023,1.056,2.45,5.67},_?(IntervalMemberQ[Interval[{1,3}],#]&)]

4





Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: RE: Count
  • Next by Date: Assigning elements to a matrix
  • Previous by thread: Re: Count
  • Next by thread: Re: Count