function varargout=rmmf(fis,varargin)
%RMMF   Remove membership function from FIS.
%
%   fis2 = RMMF(fis,varType,varIndex,'mf',mfIndex, warningDlgEnabled) removes the
%   specified membership function from the fuzzy inference system
%   associated with the FIS matrix fis. The boolean variable 'warningDlgEnabled'
%   specifies if confirmation should be requested. The variable 'varType'
%   can be either 'input' or 'output'. After deletion of a membership
%   function, all rules that contain no input or output membership
%   functions are removed from fis.
%
%   Specify the varType and mfFlag input arguments as character row vectors
%   or string scalars.
%
%   For example:
%
%           fis = mamfis('Name','tipper');
%           fis = addInput(fis,[0 10],'Name','service');
%           fis = addMF(fis,'service','gaussmf',[1.5 0],'Name','poor');
%           fis = addMF(fis,'service','gaussmf',[1.5 5],'Name','good');
%           fis = addMF(fis,'service','gaussmf',[1.5 10],'Name','excellent');
%           subplot(2,1,1), plotmf(fis,'input',1)
%           fis = rmmf(fis,'input',1,'mf',2);
%           subplot(2,1,2), plotmf(fis,'input',1)
%
%   See also ADDMF, ADDRULE, ADDVAR, PLOTMF, RMVAR.

%   Copyright 1994-2019 The MathWorks, Inc.

warning(message('fuzzy:general:warnDeprecation_General','rmmf','removeMF'))

narginchk(1,6)

if ~isa(fis,'FuzzyInferenceSystem')
    warning(message('fuzzy:general:warnDeprecation_FISStructure'))
    fis = convertfis(fis);
end

[varargout{1:nargout}] = fuzzy.internal.utility.rmmf(fis,varargin{:});
end