|
"Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <hks80o$pht$1@fred.mathworks.com>...
> "Bc "
> > Supposed I have A = [1 2 3; 4 5 6; 7 8 9] and B = [10 11 12; 13 14 15; 16 17 18]
> >
> > and I want to get C = [1 10 2 11 3 12; 4 13 5 14 6 15; 7 16 8 17 9 18];
> >
> > How would I be able to do this? I thought something like this, but it is not working for me because I am not doing it in all places on the matrix. I was wondering is there is a function for this.
> >
> > % mat 1 and mat2 are both 288x288 so output4 is 576x576
> > % zp = 288;
> > % output4 = zeros(3*zp,3*zp);
> > % output4(1:3:end,1:3:end) = mat1;
> > % output4(2:2:end,2:2:end) = mat2;
>
> % According to your example (A,B,C) which is inconsistent with your next request (Output4):
> C = zeros(size(A,1),size(A,2)*2);
> C(:,1:2:end) = A;
> C(:,2:2:end) = B;
>
> Oleg
==========================================
Thank you for the help, so the results meets my initial inquiry.
|