MathGroup Archive 1999

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

Search the Archive

Re: Counting list elements above/below a given value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17244] Re: Counting list elements above/below a given value
  • From: "Stephen P Luttrell" <luttrell at signal.dra.hmg.gb>
  • Date: Fri, 30 Apr 1999 02:34:36 -0400
  • Organization: Defence Evaluation and Research Agency
  • References: <7g0qv1$drj@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

W.W. Sampson wrote in message <7g0qv1$drj at smc.vnet.net>...
>I wish to count the number of elements within a list above
>a given value. I can do this using the following:
>
>Length[Select[Flatten[listname], value > #1&]]
>
>However, my list is a 280 x 280 matrix and consequently
>this takes a while to evaluate. My guess is that there
>must be something more efficient. I've tried:
>
>Count[listname, value > #1&]
>
>but the output given is 0, which I know to be incorrect.


Try this

Count[listname, _?(#>0&)]

Stephen P Luttrell
Signal Processing and Imagery Department
DERA Malvern, St.Andrew's Road
Malvern, United Kingdom, WR14 3PS

+44 (0)1684 894046 (tel)
+44 (0)1684 894384 (fax)
luttrell at signal.dera.gov.uk (email)




  • Prev by Date: Re: infuriating Series[] question
  • Next by Date: Re: my previous question on matrix element assignment
  • Previous by thread: Re: Counting list elements above/below a given value
  • Next by thread: 3d Custom Color Output