Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Comparing matrix to matrix
Date: Wed, 14 Mar 2012 07:29:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <jjphc7$jcu$1@newscl01ah.mathworks.com>
References: <jjpabk$t0j$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1331710151 19870 172.30.248.45 (14 Mar 2012 07:29:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 Mar 2012 07:29:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:760884

"Ho Cheung Brian" wrote in message <jjpabk$t0j$1@newscl01ah.mathworks.com>...
> Input:
> A =[1 6 3; 2 4 6;4 5 3];
> B = [1 3 5;2 7 4];
> Output:
> [1 6 3; 4 5 3; 1 3 5]
> (Order is not important)
> **My goal is merging A and B and eliminate the non-dominated vector**
> i.e. A(2,:) and B(2,:) 
> (The elements of [1 3 5] are all smaller than [2 4 6], so [2 4 6] is dominated by [1 3 5], similar to [2 7 4], which is dominated by [1 6 3])
> ........
- - - - - - - - -
  I hope I have understood your problem correctly.  Your use of the phrase "dominated by" is a bit misleading.

 A1 = reshape(A,size(A,1),1,[]);
 B1 = reshape(B,1,size(B,1),[]);
 output = [A(~any(all(bsxfun(@gt,A1,B1),3),2),:);...
           B(~any(all(bsxfun(@gt,B1,A1),3),1),:)];

Roger Stafford