<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/242947</link>
    <title>MATLAB Central Newsreader - Interleaving three vectors</title>
    <description>Feed for thread: Interleaving three vectors</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.es/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 23 Jan 2009 01:02:15 +0000</pubDate>
      <title>Interleaving three vectors</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/242947#623348</link>
      <author>Adshak</author>
      <description>Dear All,&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I have three vectors of same size or dimensions,&lt;br&gt;
&lt;br&gt;
Let us consider those three vectors all of same dimensions.&lt;br&gt;
&lt;br&gt;
a = [1 1 1 1 1....];&lt;br&gt;
b = [2 2 2 2 2.....];&lt;br&gt;
c = [3 3 3 3 3...];&lt;br&gt;
&lt;br&gt;
NOw ho dow I interleave these three vectors such as  such that my&lt;br&gt;
final vector is:&lt;br&gt;
&lt;br&gt;
vectorfinal = [1 2 3 1 2 3 1 2 3.....]  i.e this vector now is three&lt;br&gt;
times the dimensions of the sample vectors.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Advanced thank you for all your help.&lt;br&gt;
&lt;br&gt;
Adshak</description>
    </item>
    <item>
      <pubDate>Fri, 23 Jan 2009 01:26:02 +0000</pubDate>
      <title>Re: Interleaving three vectors</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/242947#623352</link>
      <author>Roger Stafford</author>
      <description>Adshak &amp;lt;adshaikh.hipnet@googlemail.com&amp;gt; wrote in message &amp;lt;394b5a8f-5212-4560-8556-2fbe882fad6d@w24g2000prd.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear All,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have three vectors of same size or dimensions,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Let us consider those three vectors all of same dimensions.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; a = [1 1 1 1 1....];&lt;br&gt;
&amp;gt; b = [2 2 2 2 2.....];&lt;br&gt;
&amp;gt; c = [3 3 3 3 3...];&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; NOw ho dow I interleave these three vectors such as  such that my&lt;br&gt;
&amp;gt; final vector is:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; vectorfinal = [1 2 3 1 2 3 1 2 3.....]  i.e this vector now is three&lt;br&gt;
&amp;gt; times the dimensions of the sample vectors.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Advanced thank you for all your help.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Adshak&lt;br&gt;
&lt;br&gt;
&amp;nbsp;vectorfinal = reshape([a;b;c],1,[]);&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Fri, 23 Jan 2009 16:59:55 +0000</pubDate>
      <title>Re: Interleaving three vectors</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/242947#623498</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
"Adshak" &amp;lt;adshaikh.hipnet@googlemail.com&amp;gt; wrote in message &lt;br&gt;
news:394b5a8f-5212-4560-8556-2fbe882fad6d@w24g2000prd.googlegroups.com...&lt;br&gt;
&amp;gt; Dear All,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I have three vectors of same size or dimensions,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Let us consider those three vectors all of same dimensions.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; a = [1 1 1 1 1....];&lt;br&gt;
&amp;gt; b = [2 2 2 2 2.....];&lt;br&gt;
&amp;gt; c = [3 3 3 3 3...];&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; NOw ho dow I interleave these three vectors such as  such that my&lt;br&gt;
&amp;gt; final vector is:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; vectorfinal = [1 2 3 1 2 3 1 2 3.....]  i.e this vector now is three&lt;br&gt;
&amp;gt; times the dimensions of the sample vectors.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Advanced thank you for all your help.&lt;br&gt;
&lt;br&gt;
Roger's given you the RESHAPE method.  Another method is to use indexing.&lt;br&gt;
&lt;br&gt;
d = zeros(1, numel(a)+numel(b)+numel(c));&lt;br&gt;
d(1:3:end) = a;&lt;br&gt;
d(2:3:end) = b;&lt;br&gt;
d(3:3:end) = c;&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
    <item>
      <pubDate>Tue, 27 Jan 2009 21:32:44 +0000</pubDate>
      <title>Re: Interleaving three vectors</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/242947#624397</link>
      <author>Adshak</author>
      <description>On Jan 23, 4:59=A0pm, "Steven Lord" &amp;lt;sl...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; "Adshak" &amp;lt;adshaikh.hip...@googlemail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; news:394b5a8f-5212-4560-8556-2fbe882fad6d@w24g2000prd.googlegroups.com...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Dear All,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have three vectors of same size or dimensions,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Let us consider those three vectors all of same dimensions.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; a =3D [1 1 1 1 1....];&lt;br&gt;
&amp;gt; &amp;gt; b =3D [2 2 2 2 2.....];&lt;br&gt;
&amp;gt; &amp;gt; c =3D [3 3 3 3 3...];&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; NOw ho dow I interleave these three vectors such as =A0such that my&lt;br&gt;
&amp;gt; &amp;gt; final vector is:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; vectorfinal =3D [1 2 3 1 2 3 1 2 3.....] =A0i.e this vector now is thre=&lt;br&gt;
e&lt;br&gt;
&amp;gt; &amp;gt; times the dimensions of the sample vectors.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Advanced thank you for all your help.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Roger's given you the RESHAPE method. =A0Another method is to use indexin=&lt;br&gt;
g.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; d =3D zeros(1, numel(a)+numel(b)+numel(c));&lt;br&gt;
&amp;gt; d(1:3:end) =3D a;&lt;br&gt;
&amp;gt; d(2:3:end) =3D b;&lt;br&gt;
&amp;gt; d(3:3:end) =3D c;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; sl...@mathworks.com- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
Thank you both so much...&lt;br&gt;
&lt;br&gt;
It worked just fine.</description>
    </item>
  </channel>
</rss>
