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

% Copyright 2002-2014 The MathWorks, Inc.
%#codegen
    
eml_allow_mx_inputs;
eml_invariant(nargin==3, 'fixed:coder:incorrectNumberOfInputs');
eml_invariant(coder.const((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 = eml_not_const(zeros(size(a0)));
    else
        ctemp = eml_not_const(zeros(size(b0)));
    end
    if isrealC
        c = ctemp;
    else
        c = complex(ctemp,ctemp);
    end
    return;
else
    eml_invariant(false, ...
        'fixed:coder:functionNotDefinedFor1stArgType', 'MPY', class(f));
end
