当前位置:网站首页>Matlab bitwise and or not
Matlab bitwise and or not
2022-07-26 01:02:00 【Vertira】
bitand Press bit and operate
a = 7;
b = bitand(10, a); % b = 2
disp(dec2bin(a, 8)); % ans = 00000111
disp(dec2bin(b, 8)); % ans = 00000010
bitor To press or operate
a = 15;
b = bitor(10,a);
disp(dec2bin(a,8)); %ans = 00001111
disp(dec2bin(b,8)); %ans = 00001111
bitxor Bitwise XOR
a = 15;
b = bitxor(10,a);
disp(dec2bin(a,8)); ans = 00001111
disp(dec2bin(b,8)); ans = 00000101
bitshift Shift operation
bitshift(12, 2), %ans = 48 Move two places to the left
bitshift(12, -2),%ans = 3 Move two places to the right
bitset Set and formulate bit position
bitset(uint8(9), 5),%ans = 25 take 9 Of the 5 Bit is set to 1
bitget Get binary bits
bitget(uint8(13), 4:-1:1), %ans = 1101
bitget(uint8(13), 1:4), %ans = 1011 Take... From right to left
bitcmp Get the complement of data
bitcmp(uint8(99)) %ans = 156
bitxor(99,255), %ans = 156 Use XOR to find complement
dec2bin(D, N) Decimal to binary
D For input ,N Value sets the minimum number of output bits
dec2bin(10, 7)
ans =
0001010bin2dec Binary to decimal
bin2dec('1011') % The internal string is required
ans =
11dec2hex Convert decimal to hexadecimal
hex2dec Hexadecimal to decimal
边栏推荐
- With data-driven management transformation, the first year of science and technology was at the right time
- 动态IP地址是什么?为什么大家会推荐用动态ip代理?
- Openvino installation pit notes
- ASP. Net core configuration
- Test the concept of left shift and right shift
- Small sample learning - getting started
- We have no way out
- 数据写入excel并填充颜色
- [RTOS training camp] course learning methods and C language knowledge (pointer, structure, function pointer, linked list) and student questions
- It will be easier to implement MES system by doing well in these four stages
猜你喜欢

【RTOS训练营】程序框架、预习、课后作业和晚课提问

RHCE之at和crontab命令详解及chrony部署

Oauth2 and JWT

微波炉整流二极管 CL01-12

JDBC实现MySQL8.0数据库的增删改查
![[plaything determination scratch children programming] ride a small motorcycle (dynamic background + camera control operation)](/img/35/5fe27d3f61b41bf4b9434cd4d7d1b1.png)
[plaything determination scratch children programming] ride a small motorcycle (dynamic background + camera control operation)

What is the difference between request forwarding and request redirection?

【Code】剑指offer 03数组中重复的数字

【RTOS训练营】上节回顾、空闲任务、定时器任务、执行顺序、调度策略和晚课提问

【RTOS训练营】I2C和UART知识和预习安排 + 晚课提问
随机推荐
Selenium assertion and JS actuator
超全的开源Winform UI库,满足你的一切桌面开发需求!
With data-driven management transformation, the first year of science and technology was at the right time
Distributed transaction and at mode principle of Seata
Unity get the animation being played
ZK-Rollups工作原理
We have no way out
[Code] refers to the repeated number in the offer 03 array
Unityvr -- robot arm scene 4- gifts and Christmas tree
Openvino installation pit notes
109. Upload local files using SAP ui5 fileuploader control
Lua基础语法
动态IP地址是什么?为什么大家会推荐用动态ip代理?
matlab 移位操作基础
什么是信息化?什么是数字化?这两者有什么联系和区别?
Zabbix监控主机及资源告警
【RTOS训练营】站在更高的角度学习C语言
聊聊研发团队中的“人”
Analysis and practice of parameter parser handlermethodargumentresolver
Subarray with 19 and K