Hello,
I have matrix A:
A = 1 2 3 4
and want to resize it to be matrix B. Matrix B should be like this:
B = 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 2 2 2 3 3 3 4 4 4 3 3 3 4 4 4 3 3 3 4 4 4
My method is an ugly one like this:
A = [1 2;3 4];scale = 3;B = []; [M N] = size(A);for i = 1:M for j = 1:N B((((i-1)*scale)+1):(i*scale),(((j-1)*scale)+1):(j*scale)) = A(i,j); endend
So, how can I resize or scale matrix up without using for loop?
Thanks for advice,
K. Pituso
Best Answer