I am trying to zero-pad the borders of an image by a certain amount (xPad, yPad) using the cat function. It takes four lines of code to achieve this. For instance, for the padding in the y direction I have:
[x, y] = size(Image);
padI = cat(2, Image, zeros(x,yPad));
padI = cat(2, zeros(x,yPad),padI);
Is it possible to concatenate in both directions similataneously using a single line of code (i.e., using cat only once)?
Any suggestions are greatly appreciated.