Re: Select Maximum Value
- To: mathgroup at smc.vnet.net
- Subject: [mg107908] Re: [mg107891] Select Maximum Value
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Tue, 2 Mar 2010 07:54:16 -0500 (EST)
- Reply-to: hanlonr at cox.net
a = {{2, 4, 1, 3, 2, 2}, {4, 7, 9, 1, 2, 4}}; Max /@ a {4,9} Bob Hanlon ---- graser <graser at gmail.com> wrote: ============= Hi I want to pick up the maximum value of each list in the Array A={{2, 4, 1, 3, 2, 2}, {4,7,9,1,2,4}} I can do it in two steps.. B=Table[Sort[A[[i]], #1>#2&], {i, 1, Length[A]}]; C=Table[B[i], {i, 1, Length[B]}]; But is there any way I can do it in just one step with Select function or any thing else? Thanks