blockCountTrue

Output the number of true elements in a Boolean array

Information

Counts the number of true elements in the Boolean input vector.

Parameters

TypeNameDefaultDescription
Integernin0Size of input array

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nin]u1Array of Boolean signals
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutputyIndex of first element being true

Components

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger[nin]booToIntCast to integer
Buildings.Controls.OBC.CDL.Integers.MultiSumsumMulSum over array elements

Revisions

  • March 29, 2024, by Antoine Gautier:
    First implementation.