.Modelica.Math.BooleanVectors.index

Information

Syntax

index(b);

Description

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.

Example

index({false, true, false, true}) returns {2,4}.

See also

allTrue, andTrue, anyTrue, countTrue, enumerate, firstTrueIndex, and oneTrue.

Interface

function index
  extends Modelica.Icons.Function;
  input Boolean b[:] "Boolean vector";
  output Integer indices[countTrue(b)] "Indices of the true elements of b";
end index;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos