Engee documentation

Submatrix

Selecting a subset of elements (submatrix) from the input matrix.

submatrix

Description

The Submatrix block extracts the submatrix y from the input matrix u of size M by N.

For details on selecting rows and columns for extraction, see section Range setting parameters.

Ports

Input

Port_1 - input matrix
scalar | vector | matrix

Initial matrix.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Fixed, Bool.

Support for complex numbers: Yes

Output

Port_1 - submatrix
matrix

The submatrix extracted from the input signal. The data type on the output is the same as on the input.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Fixed, Bool.

Support for complex numbers: Yes

Parameters

Row span - range of rows
All rows (by default) | One row | Range of rows

The range of input rows that will be saved in the output matrix.

Row - the first (single) row of the output submatrix
First (by default) | Index | Offset from last | Last | Offset from middle | Middle

The input string to be used as the first and only string of the output submatrix.

Dependencies

To use this parameter, set the Row span parameters to One row.

Starting row is the first row of the output submatrix
First (by default) | Index | Offset from last | Last | Offset from middle | Middle

Method of specifying the row in the source matrix to be used as the first row of the output submatrix.

Dependencies

To use this parameter, set the Row span parameters to Range of rows.

Row index - index of the first (single) row
1 (by default) | positive integer.

The index of the input row, which will be used as the first and only row of the output submatrix, is specified as an integer greater than or equal to one.

Dependencies

To use this parameter, set the Row span parameter to One row and the Row parameter to Index.

Starting row index - index of the first row
1 (by default) | positive integer.

The index of the input row, which will be used as the first row of the output submatrix, is specified as an integer greater than or equal to one.

Dependencies

To use this parameter, set the Row span parameter to Range of rows and the Starting row parameter to Index.

Row offset - offset of the first (single) row
1 (by default) | ` integer`.

The offset of the input row, which will be used as the first and only row of the output submatrix, is specified as an integer. The sign of the number determines the direction of the offset.

Dependencies

To use this parameter, set the Row span parameter to One row and the Row parameter to Offset from last or Offset from middle.

Starting row offset - the offset of the first row
1 (by default) | an integer.

The offset of the input row, which will be used as the first row of the output submatrix, is specified as an integer. The sign of the number determines the direction of the offset.

Dependencies

To use this parameter, set the Row span parameter to Range of rows and the Starting row parameter to Offset from last or Offset from middle.

Ending row - the last row of the output submatrix
Last (by default) | Index | Offset from last | Offset from middle | Middle

Method of specifying the row in the source matrix to be used as the last row of the output submatrix.

Dependencies

To use this parameter, set the Row span parameter to Range of rows and the Starting row parameter to any value except Last.

Ending row index - index of the last row
1 (by default) | positive integer.

The index of the input row, which will be used as the last row of the output submatrix, is specified as an integer greater than or equal to one.

Dependencies

To use this parameter, set Ending row to Index.

Ending row offset - the offset of the last row
1 (by default) | an integer.

The offset of the input row, which will be used as the last row of the output submatrix, is specified as an integer. The sign of the number determines the direction of the offset.

Dependencies

To use this parameter, set the Ending row parameters to Offset from middle or Offset from last.

Column span - range of input columns
All columns (by default) | One column | Range of columns.

The range of input columns that will be saved in the output matrix.

Column - the first (single) column
First (by default) | Index | Offset from last | Last | Offset from middle | Middle

The input column to be used as the first and only column of the output submatrix.

Dependencies

To use this parameter, set the Column span parameters to One column.

Starting column - the first column of the output submatrix
First (by default) | Index | Offset from last | Last | Offset from middle | Middle.

Method of specifying the column in the source matrix that will be used as the first column of the output submatrix.

Dependencies

To use this parameter, set the Column span parameter to Range of columns.

Starting column index - index of the first column
1 (by default) | positive integer.

The index of the input column to be used as the first column of the output submatrix, given as an integer greater than or equal to one.

Dependencies

To use this parameter, set the Column span parameter to Range of columns and the Starting column parameter to Index.

Column index is the index of the first (single) column
1 (by default) | positive integer.

The index of the input column, which will be used as the first and only column of the output submatrix, is specified as an integer greater than or equal to one.

Dependencies

To use this parameter, set the Column span parameters to One column and the Column parameters to Index.

Column offset - offset of the first (single) column
1 (by default) | an integer.

The offset of the input column, which will be used as the first and only column of the output submatrix, is specified as an integer. The sign of the number determines the direction of the offset.

Dependencies

To use this parameter, set the Column span parameter to One column and the Column parameter to Offset from last or Offset from middle.

Starting column offset - the offset of the first column
1 (by default) | an integer.

The offset of the input column, which will be used as the first column of the output submatrix, is specified as an integer. The sign of the number determines the direction of the offset.

Dependencies

To use this parameter, set the Column span parameter to Range of columns and the Starting column parameter to Offset from last or Offset from middle.

Ending column is the last column
Last (by default) | Index | Offset from last | Offset from middle | Middle

Method of specifying the column in the source matrix to be used as the last column of the output submatrix.

Dependencies

To use this parameter, set the Column span parameter to Range of columns and set the Starting column parameter to any value except Last.

Ending column index - index of the last column
1 (By default) | positive integer.

The input column index, which will be used as the last column of the output submatrix, is specified as an integer greater than or equal to one.

Dependencies

To use this parameter, set the Ending column parameters to Index.

Ending column offset - the offset of the last column
1 (by default) | integer.

The offset of the input column to be used as the last column of the output submatrix is specified as an integer. The sign of the number determines the direction of the offset.

Dependencies

To use this parameter, set the Ending column parameters to Offset from middle or Offset from last.

Read more

Range setting parameters

The block accepts an input undirected vector of length M as an M by 1 matrix. The Row span parameter provides three parameters for specifying the range of rows in the input matrix u to be stored in the output submatrix y:

  • All rows - specifies that the output submatrix y contains all M rows of the input matrix u.

  • One row - indicates that the output submatrix y contains only one row from the input matrix u. When One row is selected, the Row parameter becomes available for usage, allowing to select the desired row.

  • Range of rows - indicates that the output submatrix y contains a range of rows from the input matrix u. When Range of rows is selected, parameters Starting row and Ending row become available for usage, which allow to select the desired range of rows.

The Column span parameters contain a corresponding set of three options for specifying the range of columns in the input matrix u to be stored in the output submatrix y: All columns, One column, or Range of columns. Selecting One column includes the Column parameter, and selecting Range of columns includes the Starting column and Ending column parameters.

When One row or Range of rows is selected, the Row span parameter specifies the desired row or range of rows in the Row, Starting row and Ending row parameters. Similarly, when One column or Range of columns is selected for the Column span parameter, the desired column or range of columns is specified in the Column, Starting column and Ending column parameters.

The Row, Column, Starting row or Starting column parameters can be set in six ways:

  • First - for rows specifies that the first row of the input matrix u is to be used as the first row of the output submatrix y. If all columns are to be included, this is equivalent to .

    For columns, this means that the first column of the input matrix u should be used as the first column of the output submatrix y. If all rows are included, this is equivalent to .

  • Index - for rows indicates that the row of the input matrix u, firstrow, indexed by the Row index parameter or the Starting row index parameter should be used as the first row of the output submatrix y. When all columns are included, this is equivalent to .

    For columns, this specifies that the column of the input matrix u, firstcol indexed by the Column index parameter or the Starting column index parameter should be used as the first column of the output submatrix y. If all rows are to be included, this is equivalent to .

  • Offset from last - for rows specifies that the row of the input matrix u, offset relative to row M by the Row offset or Starting row offset parameter, firstrow, should be used as the first row of the output submatrix y. If all columns are to be included, this is equivalent to .

    For columns, this parameter specifies that a column of the input matrix u, offset relative to column N by the Column offset or Starting column offset, firstcol parameter, should be used as the first column of the output submatrix y. If all rows are to be included, this is equivalent to .

  • Last - For rows, this specifies that the last row of the input matrix u is to be used as the only row of the output submatrix y. If all columns are included in the row, this is equivalent to .

    For columns, this specifies that the last column of the input matrix u should be used as the only column of the output submatrix y. When all rows are included, this is equivalent to .

  • Offset from middle - When this option is selected, the block selects the first row or column of the output submatrix y by adding the specified offset to the middle row or column of the input matrix u. If the number of input rows or columns X is even, the block defines the middle as . If the number of input rows or columns is odd, the block defines the middle as .

    If all columns are to be included, the following code defines the initial row: , where Offset is the value of the Row offset or Starting row offset parameters. If all rows are to be included, the following code defines the starting column: , where Offset is the value of the Column offset or Starting column offset parameters.

  • Middle - when this parameter is selected, the block uses the middle row or column of the input matrix u as the first row or column of the output submatrix y. If the number of input rows or columns X is even, the block defines the middle as . If the number of input rows or columns is odd, the block defines the middle as .

    If all columns are to be included, the following code defines the initial row: . If all rows are to be included, the following code defines the starting column: .

The end row or end column can similarly be defined in five ways:

  • Index - for rows specifies that the row of the input matrix u indexed forward by the Ending row index lastrow parameter should be used as the last row of the output submatrix y. If all columns are to be included, this is equivalent to .

    For columns, this specifies that the column of the input matrix u indexed forward by the Ending column index parameter, lastcol, should be used as the last column of the output submatrix y. When all rows are included, this is equivalent to .

  • Offset from last - for rows specifies that the last row of the output submatrix y should be used as the last row of the input matrix u, offset relative to row M by the value of the end row offset parameter lastrow. When all columns are included, this is equivalent to .

    For columns, this parameter specifies that a column of the input matrix u, offset relative to column N by the Ending column offset parameter, lastcol, should be used as the last column of the output submatrix y. When all rows are included, this is equivalent to .

  • Last - for rows specifies that the last row of the input matrix u is to be used as the last row of the output submatrix y. If all columns are to be included, this is equivalent to .

    For columns, this indicates that the last column of the input matrix u should be used as the last column of the output submatrix y. When all rows must be included, this is equivalent to .

  • Offset from middle - When this option is selected, the block selects the last row or column of the output submatrix y by adding the specified offset to the middle row or column of the input matrix u. If the number of input rows or columns X is even, the block defines the middle as . If the number of input rows or columns is odd, the block defines the middle as .

    If all columns are to be included, the following code defines the end row: , where Offset is the value of the Ending row offset parameters. If all rows are to be included, the following code defines the ending column: , where Offset is the value of the Ending column offset parameters.

  • Middle - when this option is selected, the block uses the middle row or column of the input matrix u as the last row or column of the output submatrix y. If the number of input rows or columns X is even, the block defines the middle as . If the number of input rows or columns is odd, the block defines the middle as .

    If all columns are to be included, the following code defines the end row: . If all rows are to be included, the following code defines the end column: .