WOLFRAM SYSTEM MODELER

andTrue

Returns true, if all elements of the Boolean input vector are true ('and')

Wolfram Language

In[1]:=
SystemModel["Modelica.Math.BooleanVectors.andTrue"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Syntax

andTrue(b);

Description

Returns true if all elements of the Boolean input vector b are true. Otherwise the function returns false. If b is an empty vector, i.e., size(b,1)=0, the function returns true (as opposed to allTrue returning false).

Example

  Boolean b1[3] = {true, true, true};
  Boolean b2[3] = {false, true, false};
  Boolean r1, r2;
algorithm
  r1 = andTrue(b1);  // r1 = true
  r2 = andTrue(b2);  // r2 = false

See also

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

Syntax

result = andTrue(b)

Inputs (1)

b

Type: Boolean[:]

Description: Boolean vector

Outputs (1)

result

Type: Boolean

Description: = true, if all elements of b are true