Path: news.mathworks.com!not-for-mail
From: "Shobana " <manoharanshobana@ymail.com>
Newsgroups: comp.soft-sys.matlab
Subject: deleting elements from vector
Date: Tue, 25 Dec 2012 07:07:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <kbbjar$5g6$1@newscl01ah.mathworks.com>
Reply-To: "Shobana " <manoharanshobana@ymail.com>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1356419227 5638 172.30.248.47 (25 Dec 2012 07:07:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 25 Dec 2012 07:07:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3607161
Xref: news.mathworks.com comp.soft-sys.matlab:785350

hai friends...
   I need to delete some values in the vector based on the values in the another vector
for example:
  e = [1 1 0 0 2 3 , .  . . . n]
  a = [1 2 3 4 5 6 ...........n]
the result should be like this b = [1 2 5 6.....n] the value of 'a' corresponding to the place where e = = 0 should be removed.I tried like this 
for j  =1:length(e)
  if(e == 0)
   data[j] = [];
end
end

but it gives wrong answer like [1 2 4 6..n] .here the length of 'a' and 'e' are same.please reply me as soon as possible