countTrueReturns the number of true entries in a Boolean vector |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
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.
b |
Type: Boolean[:] Description: Boolean vector |
---|
n |
Type: Integer Description: Number of true entries |
---|