MATLAB: Zero padding in matrix

pad zerospadarray

Hi, I have a 5×5 matrix and i would like to pad it with zeros such that its size becomes 200×200 and the 5×5 matrix is in the middle of the 200×200. Please help.

Best Answer

a=magic(5) % example
b=zeros(200)
b(98:102,98:102)=a
Related Question