first function

Requirements.LogicalFunctions.first  · source

Icon of first

Returns the value of the first element of a Boolean vector

Extends Modelica.Icons.Function

Syntax

first(b);

Description

The function returns the value of the first element of a Boolean vector b, i.e., b[1]. The vector must have at least one element. It is typically used with Boolean vectors whose elements are ordered in time or in sequence, together with last.

Example

The property is demonstrated with the following example calling the function as:

firstBooleanElement = first( b )
simulation result

Inputs

NameTypeDescription
b[…] inputBooleanBoolean vector

Outputs

NameTypeDescription
result outputBooleanValue of the first entry