Getting data from array socket

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

 采纳的回答

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 个评论

Thanks for your fast answer, would you please see the edited question, I have more requirments

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by