Multiport Selector
Distributes arbitrary subsets of input rows or columns to multiple output ports.
Description
The Multiport Selector block extracts multiple subsets of rows or columns from an input matrix u of size M*N and propagates each new submatrix to a separate output port. See the description of the Select and Indices to output parameters for more details.
Ports
Input
Input - input signal
scalar
| vector
| matrix
Input signal u. It can be a scalar, a vector of length N or a matrix of size M by N.
Data types: Float16
| Float32
| Float64
| Int8
| Int16
| Int32
| Int64
| Int128
| UInt8
| UInt16
| UInt32
| UInt64
| UInt128
| Boolean
| Fixed-point
| Enumerated
Support for complex numbers: Yes
Output
Output(s) - subsets of rows or columns of input data
scalar
| vector
| matrix
The subsets of rows or columns of the input signal passed to each output port. Each cell in the Indices to output array defines a subset of rows or columns of the input signal to be passed to the corresponding output port.
The total number of cells in the Indices to output array determines the number of output ports in the block.
Data types: Float16
| Float32
| Float64
| Int8
| Int16
| Int32
| Int64
| Int128
| UInt8
| UInt16
| UInt32
| UInt64
| UInt128
| Boolean
| Fixed-point
| Enumerated
Parameters
Select - dimensionality of the input
Rows (by default)
| Columns
Select the input dimension:
-
Rows
- the block uses the one-dimensional indices you specify to select the rows of the matrix, and all elements in the selected rows are included. -
Columns
- the block uses the unidimensional indices you specify to select the columns of the matrix, and all elements in the selected columns are included.
The selected input row or column may appear any number of times in any of the outputs or not at all.
If the index references a non-existent input row or column, the block responds with the action you specified with the Invalid index parameter.
Indices to output - indexes to output
(4, [1:1:2; 5], [7; 8], 10:-1:6) (by default)
| `cell tuple'.
Specify row or column sets to propagate to each of the output ports as a cell array.
The cell contains a one-dimensional indexing expression indicating the subset of input rows or columns to be propagated to the -th output port. The total number of cells in the array determines the number of output ports in the block.
Example: (4, [1:2; 5], [7; 8], 10:-1:6)
.
This is an array of four cells that requires the block to generate four independent outputs (each to a separate port).
The following table shows the dimensionality of these outputs when Select=Rows
and the input dimensionality is to .
Cell | Expression | Description | Output dimensionality |
---|---|---|---|
1 |
|
String 4 input data |
at |
2 |
|
Input data lines 1, 2 and 5 |
at |
3 |
|
Lines 7 and 8 of the input data |
at |
4 |
|
Lines 10, 9, 8, 7 and 6 of the input data |
at |
Invalid index - action in case of invalid index Clip Index (by default)
| Generate Error
Specify the action to take when an invalid index value is present. You can select one of the following options:
-
Clip index
- the block reduces the index to the nearest valid value and does not issue a warning.
For example, if the block receives 64
to 4
as input and Select=Rows
, the block clips the index from 72
to 64
. For the same input, if Select=Columns
, the block cuts the index from 72
to 4
. In both cases, the block cuts the index from -2
to 1
.
-
Generate error
- the block displays a dialogue box about the error and terminates the simulation.