function mustBePositive(A)
%MUSTBEPOSITIVE Validate that value is positive
%   MUSTBEPOSITIVE(A) throws an error if A contains nonpositive values.
%   A value is positive if it is greater than zero.
%
%   Class support:
%   All numeric classes, logical
%   MATLAB classes that define these methods:
%       gt, isreal, isnumeric, islogical
%
%   See also: MUSTBENUMERICORLOGICAL, MUSTBEREAL.
        
%   Copyright 2016-2020 The MathWorks, Inc.

    if ~isnumeric(A) && ~islogical(A)
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeNumericOrLogical'));
    end
    
    if ~isreal(A)
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeReal'));
    end
    
    if ~all(A > 0, 'all')
        throwAsCaller(createValidatorException('MATLAB:validators:mustBePositive'));
    end
end
