Re: Maximum in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg97253] Re: Maximum in a list
- From: Raffy <raffy at mac.com>
- Date: Mon, 9 Mar 2009 01:05:57 -0500 (EST)
- References: <gp07ul$l0o$1@smc.vnet.net>
m = {{1, 2}, {3, 4}, {8, 3}};
1. All the elements where "j" is the max:
v = m[[All, 2]];
Pick[m, v, Max[v]]
2. The first element where "j" is the max.
m[[First@Ordering[m[[All, 2]], -1]]]