Manipulate binary element in matrix

2 次查看(过去 30 天)
Hi If i have binary digits in the element.How do i choose element bit 5 to bit 8.
A= 010101010
This A is in binary format.

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019-7-6
编辑:KALYAN ACHARJYA 2019-7-6
bin_num=str2num(A);
bin_array=num2str(bin_num)-'0';
bits_selection=bin_array(5:8)
or
bin_data=A-'0'
bits_selection=bin_data(5:8)
  1 个评论
zahrein yaacob
zahrein yaacob 2019-7-9
Thank you very much.
To understand further, how does bin_data=A-'0' can make it as a built array element.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by