function x = hex2dec(s)
%MATLAB Code Generation Library Function

%   Limitations:  
%   1. May not match MATLAB with empty inputs.
%   2. Cell array input is not currently supported (but should work if
%      assertion is removed).

%   Copyright 1984-2020 The MathWorks, Inc.
%#codegen

coder.internal.assert(nargin > 0,'MATLAB:minrhs');
coder.internal.prefer_const(s);
coder.internal.assert(~iscell(s), ...
    'Coder:toolbox:CellArraysNotSupported',mfilename);
if coder.internal.isConst(s) && ~coder.target('MATLAB')
    x = coder.const(feval('hex2dec',s));
else
    x = toDec(16,s);
    if norm(x,'inf') >= flintmax
        coder.internal.warning('MATLAB:hex2dec:InputExceedsFlintmax');
    end
end