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.

itget<br />

2bitget<br />

Purpose Get bit<br />

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

Description C = bitget(A,bit) returns the value of the bit at position bit in A. Operand<br />

A must be a nonnegative integer, and bit must be a number between 1 and the<br />

number of bits in the floating-point integer (flint) representation of A (52 for<br />

IEEE flints). To ensure the operand is an integer, use the ceil, fix, floor, and<br />

round functions.<br />

Example The dec2bin function converts decimal numbers to binary. However, you can<br />

also use the bitget function to show the binary representation of a decimal<br />

number. Just test successive bits from most to least significant:<br />

2-162<br />

disp(dec2bin(13))<br />

1101<br />

C = bitget(13,4:-1:1)<br />

C =<br />

1 1 0 1<br />

See Also bitand, bitcmp, bitmax, bitor, bitset, bitshift, bitxor

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

Saved successfully!

Ooh no, something went wrong!