.Modelica.Math.BooleanVectors.countTrue

Information

Syntax

countTrue(b);

Description

This function returns the number of true elements in a Boolean vector b.

Example

countTrue({false, true, false, true}) returns 2.

See also

allTrue, andTrue, anyTrue, enumerate, firstTrueIndex, index, and oneTrue.

Interface

function countTrue
  extends Modelica.Icons.Function;
  input Boolean b[:] "Boolean vector";
  output Integer n "Number of true elements in b";
end countTrue;

Generated at 2025-01-13T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos