23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2bitset<br />

Purpose Set bit<br />

Syntax C = bitset(A,bit)<br />

C = bitset(A,bit,v)<br />

Description C = bitset(A,bit) sets bit position bit in A to 1 (on). A must be a nonnegative<br />

integer and bit must be a number between 1 and the number of bits in the<br />

floating-point integer (flint) representation of A (52 for IEEE flints). To ensure<br />

the operand is an integer, use the ceil, fix, floor, and round functions.<br />

C = bitset(A,bit,v) sets the bit at position bit to the value v, which must be<br />

either 0 or 1.<br />

Examples Setting the fifth bit in the five-bit binary representation of the integer 9 (01001)<br />

yields 11001, or 25.<br />

C = bitset(9,5)<br />

C =<br />

25<br />

See Also bitand, bitcmp, bitget, bitmax, bitor, bitshift, bitxor<br />

bitset<br />

2-165

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!