Is there a convenient alternative of and()
in Matlab that does not check existence, number of input or output arugments, and returns a false as soon as the first false
is found without evaluating the expressions in subsequent inputs?
For example, I would like
and(0,a),
and(0,error()),
to both return false as opposed to returning error messages. Once an earliest input argument returns false
, I have no use of subsequent input arguments and I am happy to ignore syntax errors. But Matlab isn't.
(The more likely scenario for me is that the false
case of preceding inputs cover any syntax errors in later inputs.)
Is there a way around this? If I write an alternative of and()
with a (Matlab) loop on varargin
, will the alternative be slower?