function [c,ia,ib] = intersect(varargin)
%MATLAB Code Generation Library Function

%   For limitations, see eml_setop.m.

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

coder.internal.allowEnumInputs;
coder.inline('always');
eml_invariant(nargin >= 2, ...
    'MATLAB:minrhs');
eml_invariant(nargin <= 4, ...
    'MATLAB:maxrhs');
if nargout == 3
    [c,iia,iib] = eml_setop('intersect',varargin{:});
    ia = double(iia);
    ib = double(iib);
elseif nargout == 2
    [c,iia] = eml_setop('intersect',varargin{:});
    ia = double(iia);
else
    c = eml_setop('intersect',varargin{:});
end
