how to change the bit of any matrix?

2 ビュー (過去 30 日間)
Sultan Mehmood
Sultan Mehmood 2019 年 7 月 1 日
回答済み: Shameer Parmar 2019 年 7 月 1 日
A=[12 32 ;23 14];
>> D=A(:)';
>> S=de2bi(D);
>> S=de2bi(D)
S =
0 0 1 1 0 0
1 1 1 0 1 0
0 0 0 0 0 1
0 1 1 1 0 0
>> i want to make its 4th bit zero.. so what will i do?

採用された回答

Jan
Jan 2019 年 7 月 1 日
編集済み: Jan 2019 年 7 月 1 日
A = [12, 23, 32, 14];
B = bitset(A, 4, 0)
Or:
S = de2bi(A);
S(:, 4) = 0;

その他の回答 (1 件)

Shameer Parmar
Shameer Parmar 2019 年 7 月 1 日
try with this..
S(:,4) = 0

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by