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