This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Using a Bit Set block

If the Bit Set block is turned on for bit 2 bit 2 is set to 1.

A vector of constants 2.^[0 1 2 3 4] is represented in binary as [00001 00010 00100 01000 10000].

With bit 2 set to 1, the result is [00101 00110 00100 01100 10100], which is represented in decimal as [5 6 4 12 20].