MATLAB: How insert value vectors in middle band

how insert value

How insert this value
mb=[5 6 7 4 5 6 7 8 9 10 11 12 7 8 14 15 16 17 18 ...
7 8 19 21 23 25 27 29 7 20 22 24 26 28 1 2 1 2 1 2 1 2 1];
mb1=10*mb;
in the middle band
A=ones(8);
for i=1:4
for j=8-(i+2):8
A(i,j)=0;
end
end
for i=5:8
for j=1:8-(i-4)
A(i,j)=0;
end
end

Best Answer

No one knows what you mean. You have two matrices, mb and mb1. And then you create a new matrix, A, that is all zeros. Do you want mb1 to come after row 4 of A and then A picks up again after MB1 is done? If so do
output = [A(1:4,:); mb1; A(5:end, :)];