How to configure byte unpack?

조회 수: 2 (최근 30일)
ander
ander 2014년 11월 5일
답변: Dimitri MANKOV 2022년 7월 7일
Hi, I have a client-server aplication and I am sending udp packets to the server. The server takes this packets and return it to matlab. When I send packets the total size is 16 bytes (2 doubles) so I am sure that the size of returning packet is 16 byte. Then I have to unpack and for that I have the next configuration:
I think I am doing well but simulink has another opinion. The error it gives is the next:
Thanks

답변 (1개)

Dimitri MANKOV
Dimitri MANKOV 2022년 7월 7일
Hi Ander,
I'm not sure whether the Byte Unpack block is capable of outputting matrix signals... But most importantly, the dimensions don't seem to match what you're trying to achieve: if you know that you get a vector of 16 bytes as an input and want to have 2x double signals as the output, you should use the following parameters:
  • Output data type: {'double', 'double'}
  • Output dimension: {[1],[1]}
... if you want two output ports, or:
  • Output data type: {'double'}
  • Output dimension: {[2]}
... if you'd prefer one output port with a vector signal.
I hope this is helpful!
Dimitri

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by