function omitnanUnsupported(args)
%omitnanUnsupported  Check for use of unsupported omitnan flag

%   Copyright 2019 The MathWorks, Inc.

for i=1:length(args)
    if iIsOmitnan(args{i})
        me = MException(message('deep:dlarray:OmitnanUnsupported'));
        throwAsCaller(me);
    end
end

function tf = iIsOmitnan(arg)
if (ischar(arg) && isrow(arg)) || ...
        (isstring(arg) && isscalar(arg) && strlength(arg) > 0)
    tf = strncmpi(arg,'omitnan',strlength(arg));
else
    tf = false;
end
