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

 Respuesta aceptada

Guillaume
Guillaume el 24 de Mayo de 2018
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 comentario

Ahmed Tolba
Ahmed Tolba el 24 de Mayo de 2018
Thanks for your fast answer, would you please see the edited question, I have more requirments

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 24 de Mayo de 2018

Comentada:

el 24 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by