Hi, I have an array from data socket and I would like to find the value 53, then if its find, I need to find the next byte if its 0 or 1 or 2 or 3
header = fread(ropaRadarReceive,bytesToRead);
After finding the values 53, then either 0, 1, 2, 3, I need to section that array to hold the array data after 53, then 0 or 1 or 2 or 3
something like that
data = fread(header,53) if data is 0 get data after 0 till the next 53 if data is 1 get data after 1 till the next 53 ..etc

 채택된 답변

Guillaume
Guillaume 2018년 5월 24일

1 개 추천

where = find(header == 53);
if ~isempty(where)
%at least one 53 found
nextbytes = header(where + 1); %note that if more than one 53 is found, nextbytes will be a vector
%...
end

댓글 수: 1

Ahmed Tolba
Ahmed Tolba 2018년 5월 24일
Thanks for your fast answer, would you please see the edited question, I have more requirments

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

추가 답변 (0개)

카테고리

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

태그

질문:

2018년 5월 24일

댓글:

2018년 5월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by