.Modelica_Requirements.LogicalFunctions.oneTrue

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

Interface

function oneTrue
  extends Modelica.Icons.Function;
  input Boolean b[:] "Boolean vector";
  output Boolean result "= true, if exactly one element of b is true";
end oneTrue;

Generated at 2024-12-03T19:25:34Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos