function c = add(f,a0,b0)
% MATLAB Code Generation add function for fixed-point inputs

% Copyright 2002-2020 The MathWorks, Inc.
%#codegen
    
eml_allow_mx_inputs;
eml_invariant(nargin==3,eml_message('fixed:coder:incorrectNumberOfInputs'));

eml_invariant(((isscalar(a0))||(isscalar(b0))||(isequal(size(a0),size(b0)))), ...
    'fixed:fi:DimAgree');

% Check for ambiguous types and return with the correct size output
if eml_ambiguous_types
    numelA = prod(size(a0)); numelB = prod(size(b0)); %#ok
    isrealC = isreal(a0) && isreal(b0);
    if numelA > numelB
        ctemp = coder.ignoreConst(zeros(size(a0)));
    else
        ctemp = coder.ignoreConst(zeros(size(b0)));
    end
    if isrealC
        c = ctemp;
    else
        c = complex(ctemp,ctemp);
    end
    return;
else
    eml_invariant(false, ...
        'fixed:fi:undefinedFunctionGeneral', 'ADD', class(f));
end
