Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mustBeLogicalScalar

Checks that value is logical scalar or raise an error.

Syntax

  • mustBeLogicalScalar(var)
  • mustBeLogicalScalar(var, argPosition)
  • C++: void mustBeLogicalScalar(const ArrayOfVector& args, int argPosition)

Input argument

  • var - a variable: all supported types and classes that implement islogical, isscalar methods.
  • argPosition - a positive integer value: Position of input argument.

Description

mustBeLogicalScalar checks that value is logical scalar or raise an error.

Example

mustBeLogicalScalar(true)
mustBeLogicalScalar([])
mustBeLogicalScalar([true false])

See also

isscalar, islogical.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET