MathGroup Archive 2005

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

Search the Archive

Re: Matrices and Conditional Statements


On 10/18/05 at 2:44 AM, gregory.lypny at videotron.ca (Gregory Lypny)
wrote:

>If I have an n x m array called X, how can I create another  
>array, Y, whose rows are those rows in X whose 8th column contains
>the word "red" and whose 11th column is a number greater than 9?

Y = Select[X, StringMatchQ[#[[8]], "red"] && #[[11]]>9&]

Here, I am assuming the word "red" in the array is a string. If instead it is a symbol then

Y = Select[X, #[[8]] == red && #[[11]]>9&]
--
To reply via email subtract one hundred and four


  • Prev by Date: Unsorted Union
  • Next by Date: Re: Matrices and Conditional Statements
  • Previous by thread: Re: Matrices and Conditional Statements
  • Next by thread: Re: Matrices and Conditional Statements