You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: padarrayXT.m
    path of file: ./repos/u-shape3D/software
    
    the code of the file until where you have to start completion: function b = padarrayXT(varargin)
%PADARRAYXT Modified version of built-in function 'padarray'.
%   Mirroring ('symmetric' option) does not duplicate the border pixel.
%   B = PADARRAYXT(A,PADSIZE) pads array A with PADSIZE(k) number of zeros
%   along the k-th di
    
function idx = SymmetricPad(aSize, padSize, direction)

numDims = numel(padSize);

% Form index vectors to subsasgn input array into output array.
% Also compute the size of the output array.
idx   = cell(1,numDims);
for k = 1:numDims
    M = aSize(k);
    if M>1
        dimNums = uint32([1:M M-1:-1:2]);
        div = 2*M-2;
    else
        dimNums = [1 1];
        div = 2;
    end