Message-ID: <20021206174126.GB8348@pcf004.jinr.ru>
Date: 2002-12-06T18:40:03Z
From: Timur Elzhov
Subject: fast code
In-Reply-To: <Pine.GSO.3.96.1021206130810.29907A-100000@chase>
On Fri, Dec 06, 2002 at 01:12:27PM -0400, Pantelis Andreou wrote:
> I have two vectors x1 and x2 both in increasing order.
> I want to select the x1[j]th entry which is the max min of the x2[i]th
> entry. I can do this using if and for statements but is there a quick way
> to do it without running a loop?
Use `which' function:
x1[which(x2 == max(x2))]
WBR,
Timur.