Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Find function
Date: Sat, 22 Nov 2008 09:32:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gg8jih$9gv$1@fred.mathworks.com>
References: <gg8c2k$s8d$1@fred.mathworks.com> <gg8j3i$3ih$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227346321 9759 172.30.248.38 (22 Nov 2008 09:32:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 22 Nov 2008 09:32:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:502474


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gg8j3i$3ih$1@fred.mathworks.com>...
> ......
>  [p,p] = sort([a,b]);
>  t = length(b)-cumsum(p>length(a));
>  q = 1:length(p); q(p) = q;
>  y = t(q(1:length(a)));
> ......

Note: The way I wrote that assumed that a and b are row vectors.

Roger Stafford