米ultiport Selector
Distribute arbitrary subsets of input rows or columns to multiple output ports
Library
Signal Management / Indexing
dspindex
Description
The Multiport Selector block extracts multiple subsets of rows or columns from米-by-Ninput matrixu, and propagates each new submatrix to a distinct output port. The block treats an unoriented length-米vector input as an米-by-1 matrix.
TheIndices to outputparameter is a cell array whosekth cell contains a one-dimensional indexing expression specifying the subset of input rows or columns to be propagated to thekth output port. The total number of cells in the array determines the number of output ports on the block.
When you set theSelectparameter toRows
, the block uses the one-dimensional indices you specify to select matrix rows, and all elements on the chosen rows are included. When you set theSelectparameter toColumns
, the block uses the one-dimensional indices you specify to select matrix columns, and all elements on the chosen columns are included. A given input row or column can appear any number of times in any of the outputs, or not at all.
When an index references a nonexistent row or column of the input, the block reacts with the action you specify using theInvalid indexparameter.
Examples
Example 1
Consider the followingIndices to outputcell array:
{4,[1:2 5],[7;8],10:-1:6}
This is a four-cell array, which requires the block to generate four independent outputs (each at a distinct port). The table below shows the dimensions of these outputs whenSelect=Rows
and the input dimension is米-by-N.
Cell | Expression | Description | Output Size |
---|---|---|---|
1 |
|
Row 4 of input |
1-by-N |
2 |
|
Rows 1, 2, and 5 of input |
3-by-N |
3 |
|
Rows 7 and 8 of input |
2-by-N |
4 |
|
Rows 10, 9, 8, 7, and 6 of input |
5-by-N |
Parameters
- Select
-
Specify the dimension of the input to select,
Rows
orColumns
. - Indices to output
-
A cell array specifying the row- or column-subsets to propagate to each of the output ports. The number of cells in the array determines the number of output ports on the block.
- Invalid index
-
Specify how the block handles an invalid index value. You can select one of the following options:
Clip index
— Clip the index to the nearest valid value, and do not issue an alert.For example, if the block receives a
64
-by-4
input and theSelectparameter is set toRows
, the block clips an index of72
to64
. For the same input, if theSelectparameter is set toColumns
, the block clips an index of72
to4
. In both cases, the block clips an index of-2
to1
.Clip and warn
— Clip the index to the nearest valid value and display a warning message at the MATLAB®command line.Generate error
— Display an error dialog box and terminate the simulation.
Supported Data Types
Port | Supported Data Types |
---|---|
Input |
|
Outputs |
|
See Also
Permute Matrix(Simulink) | DSP System Toolbox |
Selector(Simulink) | 金宝app |
Submatrix(Simulink) | DSP System Toolbox |
Variable Selector | DSP System Toolbox |