indexReturns the indices of the true elements of a Boolean vector |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
index(b);
This function returns an integer vector that contains indices to the true elements in a Boolean vector b. The number of elements in the integer vector is the number of true elements in b.
index({false, true, false, true})
returns {2,4}
.
allTrue, andTrue, anyTrue, countTrue, enumerate, firstTrueIndex, and oneTrue.
b |
Type: Boolean[:] Description: Boolean vector |
---|
indices |
Type: Integer[countTrue(b)] Description: Indices of the true elements of b |
---|