Path: news.mathworks.com!not-for-mail
From: "Perttu Ranta-aho" <rantaahoX@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matrix matching
Date: Thu, 13 Aug 2009 19:20:07 +0000 (UTC)
Organization: Kuopion yliopisto
Lines: 8
Message-ID: <h61p17$bel$1@fred.mathworks.com>
References: <h61k2i$p69$1@fred.mathworks.com> <h61m3t$kcd$1@fred.mathworks.com> <h61oce$qq7$1@fred.mathworks.com>
Reply-To: "Perttu Ranta-aho" <rantaahoX@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250191207 11733 172.30.248.37 (13 Aug 2009 19:20:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Aug 2009 19:20:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 46220
Xref: news.mathworks.com comp.soft-sys.matlab:563193


One of the many solutions:
>> a=1:5;b=[1 3 5];c=zeros(size(a));
>> [dummy,a_iind]=ismember(b,a);
>> c(a_iind) = b;

If I got your problem right. 

_perttu