Byte Unpacking

Deconstruct data frames

  • Library:
  • Utilities


This block converts a vector of varying data types into one or more signals of user-selectable data types. The input of this block typically connects to an output port of a Receive block.

For example, suppose that you are unpacking a uint8 vector signal into three signals. The signals have the following attributes:

  1. Set the output port data type to:

    {'single', ['uint8'], ['uint8']}

    Use square brackets to represent vectors.

  2. Set the output port dimension to:

  3. Set the alignment value to 1.

  4. Connect the output signals to the Byte Unpacking block.



expand all

The block displays one input port that receives a vector of packed data. The source of the packed data determines by inheritance the data type of the packed data.

Data Types: single | double | int8 | uint8 | int16 | uint16 | int32 | uint32 | Boolean


expand all

The block displays from 1 to N output ports, as specified by elements of the cell array in the parameter Output port (unpacked) data types (cell array).

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean


expand all

Specify as a cell array the data types of the output ports (unpacked) for the different output signals. The number of elements in the cell array determines the number of output ports shown by this block instance. To represent vector elements, use square brackets in the cell array.

Specify the dimensions of the output ports as a cell array of vectors.

Each element in the output signals list starts at a multiple of the alignment value, specified from the start of the input vector. If the alignment value is larger than the size of the data type in bytes, the vector contains pad bytes of value 0.

For example, if the alignment value is 4:

  • uint32 receives no padding

  • uint16 receives 2 bytes of padding

  • uint8 receives 3 bytes of padding

See Also

Introduced in R2006a

Was this topic helpful?