init
This commit is contained in:
14
FOTF Toolbox/mustBeNonnegativeInteger.m
Normal file
14
FOTF Toolbox/mustBeNonnegativeInteger.m
Normal file
@ -0,0 +1,14 @@
|
||||
function mustBeNonnegativeInteger(a)
|
||||
%mustBeNonnegativeInteger 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 nonnegative.';
|
||||
throwAsCaller(MException(eid,msg))
|
||||
end
|
||||
if round(a)~=a
|
||||
eid='Value:Integer'; msg='Inputs must be an integer.';
|
||||
throwAsCaller(MException(eid,msg))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user