blockRealExtractSignal

Extract signals from a real input signal vector

Information

Extract signals from the vector-valued real input signal and transfer them to the vector-valued real output signal.

The extraction scheme is specified by the integer vector extract. This vector specifies which input signals are taken and in which order they are transferred to the output vector. Note that the dimension of extract has to match the number of outputs and the elements of extract has to be in the range of [1, nin]. Additionally, the dimensions of the input connector signals and the output connector signals have to be explicitly defined via the parameters nin and nout.

Example

The specification

     nin = 7 "Number of inputs";
     nout = 4 "Number of outputs";
     extract[nout] = {6,3,3,2} "Extracting vector";

extracts four output signals (nout=4) from the seven elements of the input vector (nin=7):

   y[1, 2, 3, 4] = u[6, 3, 3, 2];

Parameters

TypeNameDefaultDescription
Integernin1Number of inputs
Integernout1Number of outputs
Integer[nout]extract1:noutExtracting vector

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.RealInput[nin]uReal input signals
Buildings.Controls.OBC.CDL.Interfaces.RealOutput[nout]yReal signals extracted from the input vector with the extraction scheme specified by the integer vector

Revisions

  • October 14, 2022, by Jianjun Hu:
    Added assertion to check if there is any element in extracting vector is out of range.
  • July 19, 2018, by Jianjun Hu:
    Changed block name.
  • July 24, 2017, by Jianjun Hu:
    First implementation, based on the implementation of the Modelica Standard Library.