Create a matrix by shifting a matrix column by column to

Answers (2)

b = zeros(9, 4);
for K = 1 : 3
b((K-1)*3+1:K*3, K:K+1) = a;
end
b = kron(convmtx(a(1,:),3),ones(size(a,1),1));
or
s = size(a);
r = 2*s(2);
v = (1:s(1))';
b = kron(a0(rem((1:r) + flip(v),r)*s(1) + v),ones(s(1),1));

Categories

Asked:

on 21 Nov 2017

Edited:

on 21 Nov 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!