Function Reference: gbellmf

Function File: y = gbellmf (x, params)
Function File: y = gbellmf ([x1 x2 ... xn], [a b c])

For a given domain x and parameters params (or [a b c]), return the corresponding y values for the generalized bell-shaped membership function.

The argument x must be a real number or a non-empty vector of strictly increasing real numbers, a, b, and c must be real numbers, a must be non-zero, and b must be an integer. This membership function satisfies the equation:

     f(x) = 1/(1 + (abs((x - c)/a))^(2 * b))
 

which always returns values in the range [0, 1].

The parameters a, b, and c give:

     a == controls the width of the curve at f(x) = 0.5;
          f(c-a) = f(c+a) = 0.5
     b == controls the slope of the curve at x = c-a and x = c+a;
          f'(c-a) = b/2a and f'(c+a) = -b/2a
     c == the center of the curve
 

This membership function has a value of 0.5 at the two points c - a and c + a, and the width of the curve at f(x) == 0.5 is 2 * |a|:

     f(c - a) == f(c + a) == 0.5
     2 * |a| == the width of the curve at f(x) == 0.5
 

The generalized bell-shaped membership function is continuously differentiable and is symmetric about the line x = c.

To run the demonstration code, type "demo gbellmf" (without the quotation marks) at the Octave prompt.

See also: dsigmf, gauss2mf, gaussmf, pimf, psigmf, sigmf, smf, trapmf, trimf, zmf

Example: 1

 

 x = 0:255;
 params = [20 4 100];
 y1 = gbellmf(x, params);
 params = [30 3 100];
 y2 = gbellmf(x, params);
 params = [40 2 100];
 y3 = gbellmf(x, params);
 figure('NumberTitle', 'off', 'Name', 'gbellmf demo');
 plot(x, y1, 'r;params = [20 4 100];', 'LineWidth', 2)
 hold on;
 plot(x, y2, 'b;params = [30 3 100];', 'LineWidth', 2)
 hold on;
 plot(x, y3, 'g;params = [40 2 100];', 'LineWidth', 2)
 ylim([-0.1 1.1]);
 xlabel('Crisp Input Value', 'FontWeight', 'bold');
 ylabel('Degree of Membership', 'FontWeight', 'bold');
 grid;

                    
plotted figure