필터 지우기
필터 지우기

how to change the bit of any matrix?

조회 수: 4 (최근 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