| DSP Blockset | ![]() |
Distribute arbitrary subsets of input rows or columns to multiple output ports
Library
Signal Management / Indexing
Description
The Multiport Selector block extracts multiple subsets of rows or columns from M-by-N input matrix u, and propagates each new submatrix to a distinct output port. A length-M 1-D vector input is treated as an M-by-1 matrix.
The Indices to output parameter is a cell array whose kth cell contains a one-dimensional indexing expression specifying the subset of input rows or columns to be propagated to the kth output port. The total number of cells in the array determines the number of output ports on the block.
When the Select parameter is set to Rows, the specified one-dimensional indices are used to select matrix rows, and all elements on the chosen rows are included. When the Select parameter is set to Columns, the specified one-dimensional indices are used 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 behavior specified by the Invalid index parameter. The following options are available:
Example: For a 64-by-4 input with Select = Rows, an index of 72 is clipped to 64; with Select = Columns, an index of 72 is clipped to 4. In both cases, an index of -2 is clipped to 1.
Clip and warn -- Display a warning message in the MATLAB Command Window, and clip as above.
Generate error -- Display an error dialog box and terminate the simulation.
Examples
Consider the following Indices to output cell array:
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 when Select = Rows and the input dimension is M-by-N.
| Cell |
Expression |
Description |
Output Size |
| 1 |
4 |
Row 4 of input |
1-by-N |
| 2 |
[1:2 5] |
Rows 1, 2, and 5 of input |
3-by-N |
| 3 |
[7;8] |
Rows 7 and 8 of input |
2-by-N |
| 4 |
10:-1:6 |
Rows 10, 9, 8, 7, and 6 of input |
5-by-N |
Dialog Box
Rows or Columns.
Supported Data Types
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| Permute Matrix |
DSP Blockset |
| Selector |
Simulink |
| Submatrix |
DSP Blockset |
| Variable Selector |
DSP Blockset |
| Multiphase Clock | N-Sample Enable | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |