Main Content

Select Rows or Columns from Matrices

This example shows how to use the Variable Selector block.

Open and run the ex_variable_selector model.

The Variable Selector block returns a matrix with only the selected rows or columns of the input matrix. In this example, the Select parameter of the block is set to Rows and the Elements parameter is set to [1 3]. All the other parameters are set to their default values. Because the input is an identity matrix, the output must be [1 0 0;0 0 1].

See Also

Blocks