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 件)

カテゴリ

タグ

質問済み:

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