Contents Previous Next Subchapters

Conversion From Decimal to Hexadecimal
Syntax dec2hex(dec) dec2hex(decn) See Also hex2dec , ntoa , atoi , atod

Description
Converts the decimal values dec to hexadecimal representation where dec is an integer, real, double-precision or complex matrix. The return value is a character matrix in which the i-th row contains the hexadecimal representation of the i-th element of dec (if dec is a matrix, this refers to column major ordering of its elements).

If the argument n is present, it is equal to a positive integer and specifies the minimum number of columns in the return value of dec2hex.

Example
If you enter
     dec2hex([ 10, 16.])
O-Matrix will respond
     0A
     10

Reference
Each of the elements of dec must be equal to an integer value and if dec is complex, only its real part is used.