MATLAB: How to return the dimension of image if I had already add padding before

padding

W = ones(3);
padded = padarray(W,[1, 1],'symmetric','both');
ASK : dimension = 3×3
after padding = 5×5
can you help me, how to return the dimension back to 3×3

Best Answer

W = W(2:end-1, 2:end-1);