From: graser on 2 Mar 2010 04:15 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
From: Bob Hanlon on 2 Mar 2010 07:59 a = {{2, 4, 1, 3, 2, 2}, {4, 7, 9, 1, 2, 4}}; Max /@ a {4,9} Bob Hanlon ---- graser <graser(a)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
From: Fabrice P. Laussy on 2 Mar 2010 07:59 graser wrote: > 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}} > [...] is there any way I can do it in just one step with Select function > or any thing else? Max /@ A
From: Patrick Scheibe on 2 Mar 2010 08:01 Hi, it is simply A = {{2, 4, 1, 3, 2, 2}, {4, 7, 9, 1, 2, 4}}; Max /@ A and your code is not working at all. Cheers Patrick Am Mar 2, 2010 um 9:36 AM schrieb graser: > 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 > >
From: Harvey P. Dale on 3 Mar 2010 05:50 Max /@ A Best, Harvey -----Original Message----- From: graser [mailto:graser(a)gmail.com] Sent: Tuesday, March 02, 2010 3:36 AM Subject: Select Maximum Value 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
|
Next
|
Last
Pages: 1 2 3 Prev: Annoying error in Hypergeometric2F1 Next: Problem with Simplify and Integrating a gaussian |