Main Content

defuzz

Defuzzify membership function

Description

output = defuzz(x,mf,method) returns the defuzzified output value for membership function mf at the variable values in x using the specified defuzzification method.

example

Examples

collapse all

x = -10:0.1:10;
mf = trapmf(x,[-10 -8 -4 7]);
out = defuzz(x,mf,'centroid')
out = 
-3.2857

Input Arguments

collapse all

Variable values, specified as a vector.

Membership function values, specified as a vector with the same length as x. Each element of mf contains a fuzzy membership value for the corresponding variable value in x.

Defuzzification method, specified as one of the following:

  • 'centroid' — Centroid of the area under the output fuzzy set

  • 'bisector' — Bisector of the area under the output fuzzy set

  • 'mom' — Mean of the values for which the output fuzzy set is maximum

  • 'lom' — Largest value for which the output fuzzy set is maximum

  • 'som' — Smallest value for which the output fuzzy set is maximum

  • Character vector or string that contains the name of a custom function in the current working folder or on the MATLAB® path

For more information on:

Output Arguments

collapse all

Defuzzified output value, returned as a scalar.

Version History

Introduced before R2006a