Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Search matrix for the first closest match
Date: Sun, 21 Dec 2008 23:54:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <gimkuq$l7u$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229903642 21758 172.30.248.37 (21 Dec 2008 23:54:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 21 Dec 2008 23:54:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1560446
Xref: news.mathworks.com comp.soft-sys.matlab:508254


I have a matrix consisting of ephemeris data as below (the ... just means i skipped some data for brevity)

A =
  354.8800
  357.7500
  0.6500
  3.5800
  6.5600
  ...
  352.6400
  355.7600
  358.9400
  0.8900
  3.7900
  6.9000  

I want to be able to find the index of the first closest match to 6 within the matrix given a specific index to start the search from. Can someone show me an easy way to search the matrix? Is there a function that does this search efficiently?
Thanks!