%% Convert Numeric Array
% Create a numeric array.

D = [1023 122 14];

%
% To represent the elements of D as hexadecimal values, use the dec2hex function. Each row of hexStr corresponds to an element of D.

hexStr = dec2hex(D)

%
% The dec2hex function returns a padded character array. Starting in R2016b, the compose function is recommended for converting numeric arrays to hexadecimal representations. It returns a string array whose elements are not padded. To represent the elements of D as hexadecimal values, use either the %X or %x formatting operator.

hexStr = compose("%X",D)

% Copyright 2019-2020 The MathWorks, Inc.