last function

Requirements.LogicalFunctions.last  · source

Icon of last

Returns the value of the last element of a Boolean vector

Extends Modelica.Icons.Function

Syntax

last(b);

Description

The function returns the value of the last element of a Boolean vector b, i.e., b[size(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 first.

Example

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

lastBooleanElement = last( b )
simulation result

Inputs

NameTypeDescription
b[…] inputBooleanBoolean vector

Outputs

NameTypeDescription
result outputBooleanValue of last entry