Function Reference: defuzz

Function File: crisp_x = defuzz (x, y, defuzz_method)
Function File: crisp_x = defuzz ([x1 x2 ... xn], [y1 y2 ... yn], defuzz_method)

For a given domain, set of fuzzy function values, and defuzzification method, return the defuzzified (crisp) value of the fuzzy function.

The arguments x and y must be either two real numbers or two equal-length, non-empty vectors of reals, with the elements of x strictly increasing. defuzz_method must be a (case-sensitive) string corresponding to a defuzzification method. Defuzz handles both built-in and custom defuzzification methods.

The built-in defuzzification methods are:

MethodValue Returned
centroidReturn the x-value of the centroid.
bisectorReturn the x-value of the vertical bisector of the area.
momReturn the mean x-value of the points with maximum y-values.
somReturn the smallest (absolute) x-value of the points with maximum y-values.
lomReturn the largest (absolute) x-value of the points with maximum y-values.
wtaverReturn the weighted average of the x-values, with the y-values used as weights.
wtsumReturn the weighted sum of the x-values, with the y-values used as weights.