Table of Contents
Select by Mask
Selects elements from the input signal based on a mask.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Signal Routing')Description
The Select by Mask block allows elements of the first input to be extracted to form the output based on a mask. The mask may come from a dialog parameter or from a second input. For each non-zero element of the mask the corresponding element of the input vector is selected. For each zero element of the mask, the corresponding element of the input vector is not included in the output.
The inputs and output may be fixed or variable-size signals. If the output is fixed-size then the block also outputs the number of valid elements. If the output is variable-size, then the number of elements in the output will equal the number of non-zero elements in the mask vector.
The Select by Mask block differs from the
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc('Selector');Input Ports
u
The signal from which elements are selected.
mask
The signal containing the mask values. This input is only present when the Source of mask option is set to .
Output Ports
y
A vector of the elements selected from the the input signal, u. For a fixed-size output, the remaining elements are set to zero.
#
A uint32 value indicating the number of selected elements in the output
Data Type Support
The Select by Mask block supports any data type except fixed point, including complex and variable size signals, at the u port. The mask port accepts any of the standard Simulink built-in numeric data types, and may be variable-size.
Parameters and Dialog Box
Source of mask
The source of the mask vector: either an input port or a dialog parameter.
Mask (tunable online)
The mask vector used to select the inputs when the Source of mask parameter is set to .
Use variable-size output
Enabling this option causes the y output to be variable-size. If this option is not checked then the output is a fixed-size vector and there will be a second output, # , indicating the number of selected elements. See Variable-Size Signals for more information on variable-size signals.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.