MATLAB: How to fit smaller matrix into a larger matrix

image processingMATLABmatrixmatrix manipulation

Hello everyone,
I have A = matrix of 23×23, and I must reshape this matrix to the same size of an matrix I of 256×256. I want to form a 256×256 matrix that take all values in the 23×23 matrix and rest of the elements are zeros. How would I go about doing that?
I do not want to use pad, I simply want to create a zeros matrix with size of I and replace the values in zeros matrix with that of A.
Thank you for your time.

Best Answer

[m,n]=size(A);
I = zeros(256);
I(1:m,1:n) = A