Prev: call to mclInitializeApplication returning false after installing 2008b
Next: MATLAB Student Version, Database Toolbox, SQL Server 2008 Express;
From: AMK on 4 Mar 2010 03:45 Can someone point to a more efficient method to obtain a multi column matrix of a repeated single column? v = data(:,4); v = [v v v v v v];
From: dpb on 4 Mar 2010 13:49 AMK wrote: > Can someone point to a more efficient method to obtain a multi column matrix of a repeated single column? > > v = data(:,4); > v = [v v v v v v]; doc repmat; % for one --
From: Matt J on 4 Mar 2010 13:59 AMK <kennaster(a)gmail.com> wrote in message <1871381264.317648.1267728391027.JavaMail.root(a)gallium.mathforum.org>... > Can someone point to a more efficient method to obtain a multi column matrix of a repeated single column? > > v = data(:,4); > v = [v v v v v v]; ================ Are you sure you need this? These days, with bsxfun(), this kind of replication is rarely necessary.
From: us on 4 Mar 2010 14:05 AMK <kennaster(a)gmail.com> wrote in message <1871381264.317648.1267728391027.JavaMail.root(a)gallium.mathforum.org>... > Can someone point to a more efficient method to obtain a multi column matrix of a repeated single column? > > v = data(:,4); > v = [v v v v v v]; one of the other solutions v=(1:3).'; v=v(:,ones(1,5)) %{ % v = 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 %} us
From: AMK on 4 Mar 2010 09:37
Great! It actually might not be necessary, but I always find myself thinking I need to replicate a column like this. Thanks! |