Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Finding like values in two dissimilar arrays...
Date: Sun, 8 Feb 2009 19:31:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <gmnbtl$o2k$1@fred.mathworks.com>
References: <gmnaii$ru8$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 1234121462 24660 172.30.248.38 (8 Feb 2009 19:31:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Feb 2009 19:31:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:516942

"Jesse  markeveys" <jtm5181@psu.edu> wrote in message <gmnaii$ru8$1@fred.mathworks.com>...
> example
> m=[ 28,14,9,7,5.6,4.667,4,3.5,3.1]
> n=[14,7,4.667,3.5,2.8,2.333,2.0,1.75,1.55]
> both of these array's are of the same size. 
> so...
> how can I configure a while/for loop to check m in descending order to find the largest common value of n=m.

  Presumably you are not requiring the positions in m and n to be the same in comparing their elements.  (If not, it puzzles me why you require them to be the same size.)

  If not, just do an 'intersect' and select the last one in the result.  You don't need to use loops on this problem.

Roger Stafford