defuzz

Defuzzify membership function

Syntax

out = defuzz(x,mf,type) 

Description

defuzz(x,mf,type) returns a defuzzified value out, of a membership function mf positioned at associated variable value x, using one of several defuzzification strategies, according to the argument, type. The variable type can be one of the following:

  • 'centroid' — Centroid of the area under the output fuzzy set. This method is the default for Mamdani systems.

  • '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

You can also specify type using a 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 using custom functions, see Build Fuzzy Systems Using Custom Functions.

Examples

collapse all

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

Introduced before R2006a