Just make up a mask with true or false where you want it to process, or skip. Then
for j=2:column_size-1;
for i=2:row_size-1;
if ~mask(i, j)
% Mask is false here, so skip rest of the loop.
continue;
end
% Else mask is true, so do the rest of the loop.
end
end
The "false" region(s) shape mask can be whatever shape you want, but the overall size should be row_size by column_size.