Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Selecting from arrays' topicStudent Support Forum > General > "Selecting from arrays"

Next Comment >Help | Reply To Topic
Author Comment/Response
Scott
06/07/12 01:59am

Hi,

I have a problem selecting from a list. A simple example is as follows:

{{2,9,8}, {5,1,3}, {7,2,6}, {8,7,4}, {9,7,2}}

For each of the nested lists, I would like to select the first element if the second element is greater than the third. In this example this should be:

{2,8,9}

I could use a loop to move through the list but would rather use a function like "Select" (as I imagine looping would be slower for large arrays). Also, is it possible to do so without virtual functions?

Thanks in advance,
Scott


URL: ,

Subject (listing for 'Selecting from arrays')
Author Date Posted
Selecting from arrays Scott 06/07/12 01:59am
Re: Selecting from arrays Bill Simpson 06/07/12 5:18pm
Re: Re: Selecting from arrays Scott 06/07/12 8:44pm
Next Comment >Help | Reply To Topic