Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using ismember for binary search
Date: Mon, 1 Aug 2011 03:42:27 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <j157b3$jms$1@newscl02ah.mathworks.com>
References: <j14vsi$32l$1@newscl02ah.mathworks.com> <j155s9$gcr$1@newscl02ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl02ah.mathworks.com 1312170147 20188 172.30.248.47 (1 Aug 2011 03:42:27 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Aug 2011 03:42:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1959943
Xref: news.mathworks.com comp.soft-sys.matlab:738234

"Image Analyst" wrote in message <j155s9$gcr$1@newscl02ah.mathworks.com>...
> Lyle:
> Run this demo.  Perhaps all will then become clear:
> 
> a = sort(randi(100, 1, 10))
> valueToLookFor = a(4)
> logicalIndexes = squeeze(ismember(a, valueToLookFor))
> actualIndex = find(logicalIndexes, 1, 'first')
> fprintf('Found %d in "a" at index %d\n', valueToLookFor, actualIndex);

Hi image, 
i think you'll find that solution only solves a subset of the problems defined in my example.

Ragards..