MathGroup Archive 2010

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

Search the Archive

Re: Question about Mathematica


Hi,
> 
> I have a table of a table of number pairs:
> 
> {{{1,2),(3,-1),{2,-4)},{{1,2},{4,-5},{6,-8}},{{2,-1},{-2,-3},{-4,6}}}
> 
> How may I find the minimum second element in each sub-table?  For 
> example, the first sub-table is:
> 
> {{1,2},{3,-1},{2,-4}}
> 
> I would like to then extract the {2,-4} element from this item.  Then 
> the {6,-8} from the second sub-table, then the {-2,-3} element from the 
> last.
> 
> Thank you,
> Dominic

One possibility:

Map[SortBy[#, Last][[1]] &, data]

hth,

albert


  • Prev by Date: Hessian Matrix of a Numerical Defined Function
  • Next by Date: Re: Question about Mathematica
  • Previous by thread: Re: Question about Mathematica
  • Next by thread: Re: Question about Mathematica