function x = fliplr(x)
%MATLAB Code Generation Library Function
%
% Limitations:
% 
%   1. Cell input is not supported

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

coder.internal.allowEnumInputs;
coder.internal.allowHalfInputs;
eml_invariant(nargin > 0,'MATLAB:minrhs');
eml_invariant(~iscell(x), ...
    'Coder:toolbox:CellArraysNotSupported', mfilename);
ONE = coder.internal.indexInt(1);
m = coder.internal.indexInt(size(x,1));
n = coder.internal.indexInt(size(x,2));
nd2 = eml_rshift(n,ONE);
npages = coder.internal.prodsize(x,'above',2);
for p = 1:npages
    for j1 = 1:nd2
        j2 = n-j1+1;
        for i = 1:m
            xtmp = x(i,j1,p);
            x(i,j1,p) = x(i,j2,p);
            x(i,j2,p) = xtmp;
        end
    end
end
