This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Data Mapper

Map integer symbols from one coding scheme to another

  • Library:
  • Utility Blocks


The Data Mapper block accepts integer inputs and maps them to integer outputs. The mapping types include: binary to Gray coded, Gray coded to binary, and user defined. Additionally, a pass through option is available.

Gray coding is an ordering of binary numbers such that all adjacent numbers differ by only one bit.



expand all

Input signal, specified as a scalar, vector, or matrix of integers. Elements of the input signal must be nonnegative values. The block truncates noninteger values to integer values. When the input is a matrix, the columns are treated as independent channels.

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


expand all

Output signal, returned as a scalar, column vector, or matrix. The dimensions of the output signal match those of the input signal.

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


expand all

Mapping mode, specified as one of the four options. The mapping for the Binary to Gray and the Gray to Binary modes are shown in the following table when the inputs range from 0 to 7.

Binary to Gray ModeGray to Binary Mode
0 0 (000) 0 (000) 0
1 1 (001) 1 (001) 1
2 3 (011) 2 (010) 3
3 2 (010) 3 (011) 2
4 6 (110) 4 (100) 7
5 7 (111) 5 (101) 6
6 5 (101) 6 (110) 4
7 4 (100) 7 (111) 5

When you select the User Defined mode, you can use any arbitrary mapping by providing a vector to specify the output ordering. When you select the Straight Through mode, the output equals the input.

Symbol set size, specified as a positive integer. This parameter restricts the inputs and outputs to integers in the range of 0 to M-1.

Mapping vector, specified as vector of nonnegative integers whose length equals . This parameter defines the relationship between the input and output integers. For example, the vector [1 5 0 4 2 3] defines the following mapping:


Introduced before R2006a

Was this topic helpful?