MATLAB: How to add a matrix to a specfic place in bigger matrix

addbig matrixMATLABMATLAB and Simulink Student Suitematrix

Hello,
I have a big matrix: xt=zeros(6,6);
I want to add this matrix t=[1 1 ; -1 1];
So that xt becomes: xt =
1 1 0 0 0 0
-1 1 0 0 0 0
0 0 1 1 0 0
0 0 -1 1 0 0
0 0 0 0 1 1
0 0 0 0 -1 1
I want to generalize it for any size of xt but the same size of t.
Thanks in advance!

Best Answer

xt = xt + kron( speye(size(xt)/2), t)