Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: compare two vectors
Date: Sun, 2 Nov 2008 00:45:03 +0000 (UTC)
Organization: HKU
Lines: 14
Message-ID: <geit6f$8ev$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1225586703 8671 172.30.248.35 (2 Nov 2008 00:45:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 2 Nov 2008 00:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 91929
Xref: news.mathworks.com comp.soft-sys.matlab:498468


Hi,

I have two vectors:

a=[1 1 1 1 1 2 2 3 4 5 6 7]'
b = [1 1 2 2 5 6]'

I want to get the following result:
r = [1 1 1 3 4 7]'

What code can I use?
Thanks a lot!

Ann