Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Insert elements into the vector
Date: Wed, 24 Jun 2009 22:37:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <h1u9qc$5o4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1245883021 5892 172.30.248.37 (24 Jun 2009 22:37:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 24 Jun 2009 22:37:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1875128
Xref: news.mathworks.com comp.soft-sys.matlab:550459


Hi 
I would like to insert values into a vector with the location of insertion known, how do I insert them. 
For example,
A = [2 ; 2; 3; 4]
A = 2
      2
      3
      4   
       
I want to insert 0 every 1 element(variable, can change) i.e 
B = 2
      0
      2
      0
      3
      0
      4
      0

Thanks 
Diego