%% Convert Numeric Array to Octal Values
% Create a numeric array.

D = [1023 122 14];

%
% To represent the elements of D as octal, or base-8, values, use the dec2base function. Each row of baseStr corresponds to an element of D.

baseStr = dec2base(D,8)

%
% The dec2base function returns a character array padded with leading zeros. Starting in R2016b, the compose function is recommended for converting numeric arrays to octal representations. It returns a string array whose elements do not have leading zeros. To represent the elements of D as octal values, use the %o formatting operator.

hexStr = compose("%o",D)

% Copyright 2019 The MathWorks, Inc.