function p = istriu(x)
%MATLAB Code Generation Library Function

%   Copyright 2013-2014 The MathWorks, Inc.
%#codegen

narginchk(1,1);
eml_invariant(isnumeric(x), ...
    'Coder:toolbox:unsupportedClass',mfilename,class(x));
p = ismatrix(x);
if p && ~isempty(x)
    m = coder.internal.indexInt(size(x,1));
    n = coder.internal.indexInt(size(x,2));
    if m <= n
        minmn = m;
    else
        minmn = n;
    end
    for j = 1:minmn
        for i = j+1:m
            if ~(x(i,j) == 0)
                p = false;
                if ~coder.target('HDL')
                    return
                end
            end
        end
    end
end

