countTrue(b);
This function returns the number of true elements in a Boolean vector b.
countTrue({false, true, false, true})
returns
2.
allTrue, andTrue, anyTrue, enumerate, firstTrueIndex, index, and oneTrue.
function countTrue extends Modelica.Icons.Function; input Boolean b[:] "Boolean vector"; output Integer n "Number of true elements in b"; end countTrue;