I have a bit string like bit = [1 1 1 1 1 1 0 1 0 1 0 1 0]
i want to use for to check after the first 7 bits, if it is 1111110, then start to get the signal from the 8th bit, but i dont know how to do that, hope everyone can help me, thanks!

댓글 수: 1

if strcmp(num2str(bit(1:7)),num2str([1 1 1 1 1 1 0]))
%your code to read 8th bit
bit8 = bit(8);
end

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2018년 10월 17일

0 개 추천

bit = [1 1 1 1 1 1 0 1 0 1 0 1 0];
if length(bit) >= 7 && isequal(bit(1:7), [1 1 1 1 1 1 0])
signal = bit(8:end);
...
end

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2018년 10월 17일

답변:

Jan
2018년 10월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by