functioncard
Returns the number of elements of a Boolean vector that are true
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
card(b);
Description
The function returns the number of true-elements of Boolean vector b.
Example
The property is demonstrated with the following example calling the function as:
nTrueElements = card( b )
![]() |
|
| simulation result |
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean[:] | b | Boolean vector |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | result | Number of true entries |
