oneTrue function
Requirements.LogicalFunctions.oneTrue
· source
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
| Name | Type | Description |
|---|---|---|
b[…] input | Boolean | Boolean vector |
Outputs
| Name | Type | Description |
|---|---|---|
result output | Boolean | = true, if exactly one element of b is true |
