Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Insert zeros into a vector
Date: Wed, 24 Jun 2009 23:20:17 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <h1ucbh$f5i$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 1245885617 15538 172.30.248.35 (24 Jun 2009 23:20:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 24 Jun 2009 23:20:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1875128
Xref: news.mathworks.com comp.soft-sys.matlab:550469


Hi, 
I want to insert zeros into a vector in various positions.  But not necessarily every other elements.  For example
A = [ 1; 3; 4 ;5 ;6;7]
A =
     1
     3
     4
     5
     6
     7
I want to insert at the every 3 rd positon
     1
     3
     0 
     4
     5 
     0
     6
     7
     0
What is the most efficient way of doing this?
Thanks.
Diego