hex

Syntax

hex(X, [reverse=false])

Arguments

X is an integer scalar/vector.

reverse (optional) is a Boolean value indicating whether to reverse the order of the result. The default value is false.

Details

Convert data of INTEGRAL, FLOAT, COMPLEX, and BINARY types to hexadecimal and return a string. For details, see Data Types.

Examples

hex(16 25)
// Output: ["00000010","00000019"]

hex(16 25,true)
// Output: ["10000000","19000000"]
hex(compress(1 2 3))
// Output: ["00","05","ff","01","04","04","00","00","ff","ff","ff","ff","03","00","00","00","ff","ff","ff","ff","0d","00","00","80","c0","01","00","00","00","02","00","00","00","03","00","00","00"]
hex(123.456 3.1415926)
//output: ["405edd2f1a9fbe77","400921fb4d12d84a"]