Manipulate binary element in matrix
1 回表示 (過去 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.
0 件のコメント
採用された回答
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)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!