Functions | |
function | assert (cond, varargin) in |
if(nargin==1||(nargin > 1 &&islogical(cond)&&ischar(varargin{1}))) if(!isnumeric(cond)||!all(cond(else | error (varargin{:}) |
endif endif else | if (nargin< 2||nargin > 3) print_usage() |
if (nargin< 3) tol=0 | |
endif | if (exist("argn")==0) argn |
if (ischar(expected)) iserror | |
elseif (iscell(expected)) if(!iscell(cond)||any(size(cond)! | |
end_try_catch endif | elseif (isstruct(expected)) if(!isstruct(cond)||any(size(cond)! |
endif | if (empty) v |
endif | if (normal) v |
endif | assert (v,{expected.(k)}, tol) |
end_try_catch endif | elseif (ndims(cond)!=ndims(expected)||any(size(cond)!=size(expected))) iserror |
Variables | |
for | i |
endfor | in = cstrcat ("(", in, ")") |
endif | expected = varargin {1} |
else | tol = varargin {2} |
endif | coda = "" |
iserror = 0 | |
else try | empty = numel (cond) == 0 |
normal = numel (cond) == 1 | |
for [v, k] | |
else | v = v(:)' |
endif assert | ( | v | ) |
function assert | ( | cond | , | |
varargin | ||||
) |
elseif | ( | iscell(expected) | ) |
if (nargin == 1 || (nargin > 1 && islogical (cond) && ischar (varargin{1}))) if (! isnumeric (cond) || ! all (cond( else error | ( | ) |
if | ( | ischar(expected) | ) |
endif if | ( | exist("argn") | = =0 |
) |
if | ( | ) | [pure virtual] |
coda = "" |
normal = numel (cond) == 1 |
else v = v(:)' |