function y = issortedrows(x,varargin)
%MATLAB Code Generation Library Function

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

coder.internal.allowEnumInputs;
narginchk(1,7);
coder.internal.assert(~iscell(x), ...
    'Coder:toolbox:CellArraysNotSupported',mfilename);
coder.internal.assert(ismatrix(x), ...
    'MATLAB:issortedrows:MustBeMatrix');
y = true;
m = coder.internal.indexInt(size(x,1));
n = coder.internal.indexInt(size(x,2));
[col,comparisonMethod,missingPlacement,monotonic,strict] = ...
    coder.internal.parseSortrowsOptions(n,varargin{:});
if m == 1 && n > 0 && ~isempty(strict) && strict(1)
    y = coder.internal.reduceToScalar(x,@(p,x)and(p,~isnan(x)),true);
else
    for k = 2:m
        [y,col,monotonic] = coder.internal.sortrowsLE(x,col,k-1,k, ...
            comparisonMethod,missingPlacement,strict,monotonic);
        if ~y
            break
        end
    end
end