Assume that the “ERROR”, e, is bounded in an interval [a, b], where a and b are the lower bound and upper bound, respectively. The Gaussian function is selected as the membership function to characterize the 5 fuzzy sets for the “ERROR”.
The mathematical expression for a Gaussian function is given by
μj(x) = exp{-0.5*[(x − cj) / σj]2}
where
j = {1, 2, 3, 4, 5},
c is the center of the peak,
σ = 0.5*(cj − cj−1) / √[−2*ln(†)], determines the width of the curve,
† = crossing point of adjacent MFs (default for † is 0.5).
To determine the centers, cj, you need to compute the sub-interval between each peak, (cj − cj−1), where the 5 fuzzy sets are uniformly distributed to cover the domain of e:
n = number of MFs,
range = b − a,
partition = n − 1,
sub-interval = range / partition.
For example, if the universe of discourse for “ERROR” would be the interval [−5, 5], then the sub-interval = 10 / 4 = 2.5, and the centers would be {−5, −2.5, 0, 2.5, 5}.
The standard deviation, σ = 0.5*(2.5) / √[−2*ln(0.5)] ≈ 1.06165.
The following figure, plotted using Wolfram|Alpha, depicts the five fuzzy sets defined for the “ERROR” variable. However, you can easily write an m-script to plot that.
P.S. To design a fuzzy logic controller in MATLAB, a separate discussion maybe needed.