function x = fftshift(x,dim)
%MATLAB Code Generation Library Function

%   Copyright 1984-2020 The MathWorks, Inc.
%#codegen

coder.internal.allowHalfInputs;
eml_invariant(nargin > 0, ...
    'MATLAB:minrhs');
if nargin == 1
    for dim = ones(coder.internal.indexIntClass):ndims(x)
        x = eml_fftshift(x,dim);
    end
else
    coder.internal.prefer_const(dim);
    coder.internal.assertValidDim(dim);
    x = eml_fftshift(x,dim);
end
