MATLAB: How to extract bits that are not contiguous from a stored integer value in Simulink 6.4 (R2006a)

simulink

The "Extract Bits" block in Simulink 6.4 (R2006a) allows the extraction of a contiguous selection of bits from the stored integer value of the input signal, but does not allow the user to specify a non-contiguous list of bits to be extracted.

Best Answer

The ability to extract non-contiguous bits from a stored integer value is not available in Simulink 6.4 (R2006a)
To work around this issue, use the Embedded MATLAB Funtion block to create a function that will perform the task. The attached example model 'bit_ops_fin' demonstrates how this can be done using the Embedded MATLAB Function block.