14 lines
431 B
Matlab
14 lines
431 B
Matlab
function mustBePositiveInteger(a)
|
|
%mustBePositiveInteger a function to validate the argument
|
|
|
|
% Copyright (c) Dingyu Xue, Northeastern University, China
|
|
% Last Modified 18 May, 2022
|
|
if a<=0
|
|
eid='Value:Positive'; msg='Inputs must be positive.';
|
|
throwAsCaller(MException(eid,msg))
|
|
end
|
|
if round(a)~=a
|
|
eid='Value:Integer'; msg='Inputs must be an integer.';
|
|
throwAsCaller(MException(eid,msg))
|
|
end
|
|
end |