Path: news.mathworks.com!not-for-mail
From: "Keith Barth" <denrick888@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Fastest way to match the closest value in a vector.
Date: Sat, 14 Apr 2012 01:37:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <jmakc3$61e$1@newscl01ah.mathworks.com>
Reply-To: "Keith Barth" <denrick888@gmail.com>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1334367427 6190 172.30.248.45 (14 Apr 2012 01:37:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 14 Apr 2012 01:37:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3436349
Xref: news.mathworks.com comp.soft-sys.matlab:764393

Suppose I have a vector x in ascending order that is evenly spaced. (e.g., x=linspace(0,90,N) )

Suppose x(i)=<y<x(i+1). What is the fastest way to find i?

Thanks so much in advance!!!!! :)