MathGroup Archive 2006

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

Search the Archive

Re: Count Function


On Apr 5, 2006, at 6:55 AM, Gregory Lypny wrote:

> The syntax will be the death of me.
>
> Count[X[[All,14]], -9.] will tally how many elements in column 14 of
> matrix X are equal to -9, but I can't for the life of me figure out
> how to get how many are greater than -9.  Any hint would be most
> appreciated.
>
> 	Greg
>

Here is a newbie approach:

In[1]:=
xmat = Table[Table[
     Random[Integer,
      {1, 100}], {i, 1, 20}],
    {j, 1, 30}]


In[6]:=
Length[Select[xmat[[All,14]],
    #1 > 9 & ]]
Out[6]=
25


János


----------------------------------------------
Trying to argue with a politician is like lifting up the head of a  
corpse.
(S. Lem: His Master Voice)


  • Prev by Date: Sphere
  • Next by Date: Re: Count Function
  • Previous by thread: Count Function
  • Next by thread: Re: Count Function