functiononeTrue

Returns true if exactly one element of a Boolean vector is true ('xor' of all elements)

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

oneTrue(b);

Description

The function returns true if exactly one element of a Boolean vector is true ('xor' of all elements).

Example

The property is demonstrated with the following example calling the function as:

oneTrueElement = oneTrue( b )
simulation result

Inputs

TypeNameDefaultDescription
Boolean[:]bBoolean vector

Outputs

TypeNameDefaultDescription
Booleanresult= true, if exactly one element of b is true