Navigation

Operators and Keywords

Function List:

C++ API

assert.m File Reference


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(:)'

Function Documentation

endif assert (  ) 

function assert ( cond  ,
varargin   
)

end_try_catch endif elseif ( ndims(cond)!  = ndims(expected)||any(size(cond)!=size(expected))  ) 

end_try_catch endif elseif ( isstruct(expected  ) 

elseif ( iscell(expected  ) 

if (nargin == 1 || (nargin > 1 && islogical (cond) && ischar (varargin{1}))) if (! isnumeric (cond) || ! all (cond( else error (  ) 

endif if ( normal   ) 

endif if ( empty   ) 

if ( ischar(expected  ) 

endif if ( exist("argn")  = =0  ) 

if (  )  [pure virtual]

endif endif else if ( nargin< 2||nargin 3  ) 


Variable Documentation

coda = ""

else try empty = numel (cond) == 0

endif expected = varargin {1}

for[v, k]

Initial value:

 cond
            if (! isfield (expected, k))
              error ()

else try for i

Initial value:

 2:rows (argn)
    in = cstrcat (in, ",", deblank (argn(i,:)))

endfor in = cstrcat ("(", in, ")")

endfor catch iserror = 0

normal = numel (cond) == 1

else tol = varargin {2}

else v = v(:)'