1 function checkvar(x,typeSpec,varargin)
5 isChar=ischar(typeSpec);
6 if isChar&&~eval(typeSpec)||~isChar&&~builtin(
'feval',typeSpec,x)
11 checkName=func2str(typeSpec);
14 defaultErrorMessage=[
'%s is expected to comply with all of ',...
15 'the following conditions: %s'];
17 [reg,~,errorTag,errorMessage,nCallerStackStepsUp]=
mxberry.
core.parseparext(...
19 {
'errorTag',
'errorMessage',
'nCallerStackStepsUp';...
20 'wrongInput',defaultErrorMessage,1;...
22 'isscalar(x)&&isnumeric(x)&&isreal(x)'},[0,1],...
23 'regDefList',{inputname(1)},...
26 errorMessage=sprintf(errorMessage,varName,checkName);
29 'nCallerStackStepsUp',1+nCallerStackStepsUp);
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function checkvar(in x, in typeSpec, in varargin)
CHECKVAR checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x...
function isstring(in inpArray)