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$>
References: <gmnaii$ru8$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1234121462 24660 (8 Feb 2009 19:31:02 GMT)
NNTP-Posting-Date: Sun, 8 Feb 2009 19:31:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:516942

"Jesse  markeveys" <> wrote in message <gmnaii$ru8$>...
> 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