User`s guide
Variable Selector
5-504
5Variable Selector
Purpose Select a subset of rows or columns from the input.
Library Signal Management / Indexing
Description The Variable Selector block extracts a subset of rows or columns from the 
M-by-N input matrix at the 
In port, u. 
When the Select parameter is set to Rows, the Variable Selector block 
extracts rows from the input matrix, while if the Select parameter is set to 
Columns, the block extracts columns.
When the 
Selector mode parameter is set to Variable, the length-L vector 
input to the 
Idx port selects L rows or columns of u to pass through to the 
output. The elements of the indexing vector can be updated at each sample 
time, but the vector length must remain the same throughout the simulation.
When the 
Selector mode parameter is set to Fixed, the Idx port is disabled, 
and the length-L vector specified in the 
Elements parameter selects L rows or 
columns of u to pass through to the output. The 
Elements parameter is 
tunable, so you can change the values of the indexing vector elements at any 
time during the simulation; however, the vector length must remain the same. 
For both variable and fixed indexing modes, the row selection operation is 
equivalent to
y = u(idx,:) % Equivalent MATLAB code
and the column selection operation is equivalent to
y = u(:,idx) % Equivalent MATLAB code
where idx is the length-L indexing vector. The row selection output size is 
L-by-N and the column selection output size is M-by-L. Input rows or columns 
can appear any number of times in the output, or not at all. 
When the input is a 1-D vector, the 
Select parameter is ignored; the output is 
a 1-D vector of length L containing those elements specified by the length-L 
indexing vector.
When an element of the indexing vector 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:










