Using Matlab bitget () function


Matlab image processing Day5:

1, bitget () function:

% Personal feel biget () function can be roughly divided into two categories: 1, from the low to high output mode 2, the output from the high to low mode

<I>, the low to high output fixation mode bitget (x, m: n);% Parameters: x is to be converted into binary numbers, the lower output from the low bit to the m n-bit digital

Sample:

<  II>, the output from the high to the low fixed pattern bitget (x, m: -1:       n);

   % Parameters: x same meaning as above, m represents the first of several high from the beginning, I think we can put 1 in here understood as a marker to let the output of the median descending output (default is on the way, does not require labeling)

   % N represents an output from a high to low to m n bits (i.e.: if m = 4, n = 3, the outputs 3 and 4)

  

Sample:


 % Ps: because no function definition content to see the written test data are based on the conclusions, there may be discrepancy with the actual situation, purely personal opinion


Attachment:

Matlab, how to extract a bit of a binary number

代码:
a=100; %十进制
b=dec2bin(a) %变成二进制字符串
c=b(1) %下标引用所需要的位值

More Reference:

https://ww2.mathworks.cn/help/matlab/ref/bitget.html

Published 124 original articles · won praise 69 · views 90000 +

Guess you like

Origin blog.csdn.net/edward_zcl/article/details/103981449