oneTrue function

Requirements.LogicalFunctions.oneTrue  · source

Icon of oneTrue

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

Extends Modelica.Icons.Function

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

NameTypeDescription
b[…] inputBooleanBoolean vector

Outputs

NameTypeDescription
result outputBoolean= true, if exactly one element of b is true