fisOut = removeMF(fisIn,varName,mfName)
removes the membership function mfName from the input or output
variable varName in the fuzzy inference system
fisIn and returns the resulting fuzzy system in
fisOut. To use this syntax, varName must be a
unique variable name within fisIn.
fisOut = removeMF(fisIn,varName,mfName,'VariableType',varType)
removes the membership function from either an input or output variable as specified by
varType. Use this syntax when your FIS has an input variable with
the same name as an output variable.
varOut = removeMF(varIn,varName,mfName)
removes the membership function mfName from the fuzzy variable
varIn and returns the resulting fuzzy variable in
varOut.
Create a Mamdani fuzzy inference system with two inputs and one output. By default, when you specify the number of inputs and outputs, mamfis adds three membership functions to each variable.
View the membership functions for the first input variable.
plotmf(fis,"input",1)
Remove the second membership function, mf2, from the first input variable.
fis = removeMF(fis,"speed","mf2");
View the membership functions again. The specified membership function has been removed.
plotmf(fis,"input",1)
If your system has an input variable with the same name as an output variable, you must specify the variable type when removing a membership function. For example, remove the mf3 membership function from the output variable.
Create a fuzzy variable with a specified range and add three membership functions.
var = fisvar([0 10]);
var = addMF(var,"trimf",[0 2.5 5],"Name","small");
var = addMF(var,"trimf",[2.5 5 7.5],"Name","medium");
var = addMF(var,"trimf",[5 7.5 10],"Name","large");
View the membership functions.
var.MembershipFunctions
ans =
1x3 fismf array with properties:
Type
Parameters
Name
Details:
Name Type Parameters
________ _______ _________________
1 "small" "trimf" 0 2.5 5
2 "medium" "trimf" 2.5 5 7.5
3 "large" "trimf" 5 7.5 10
Remove the medium membership function from the variable.
var = removeMF(var,"medium");
Verify that the membership was removed.
var.MembershipFunctions
ans =
1x2 fismf array with properties:
Type
Parameters
Name
Details:
Name Type Parameters
_______ _______ _______________
1 "small" "trimf" 0 2.5 5
2 "large" "trimf" 5 7.5 10
mamfistype2 object — Type-2 Mamdani fuzzy inference system
sugfistype2 object — Type-2 Sugeno fuzzy inference system
varName — Variable name string | character vector
Variable name, specified as a string or character vector. You can specify the name
of either an input or output variable in your FIS.
mfName — Membership function name string | character vector
Membership function name, specified as a string or character vector.
varType — Variable type string | character vector
Variable type, specified as one of the following:
"input" — Input variable
"output" — Output variable
If your system has an input variable with the same name as an output variable,
specify which variable to remove the membership function from using
varType.
The membership function with the specified name is removed from the specified
variable.
The specified membership function is removed from any fuzzy rules. If a rule has
only the specified membership function in its antecedent, then the entire rule is
removed. If a rule has more than one membership function in its antecedent, then the
specified membership function is removed from the antecedent.
varOut — Fuzzy variable fisvar object
Fuzzy variable, returned as a fisvar object.
varOut has the same properties as varIn
except the membership function with the specified name is removed.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.