Sie sind auf Seite 1von 21

evalmf

Generic membership function evaluation


collapse all in page

Syntax
y = evalmf(x,mfParams,mfType)

Description
evaluates any membership function, where x is the variable range for the
membership function evaluation, mfType is a membership function from the toolbox,
and mfParamsare appropriate parameters for that function.
evalmf

If you want to create your own custom membership function, evalmf still works, because it
evaluates any membership function whose name it does not recognize.

Examples
collapse all

Evaluate Membership Function


Open This Example

Evaluate a generalized bell-shaped membership function.


x = 0:0.1:10;
mfparams = [2 4 6];
mftype = 'gbellmf';
y = evalmf(x,mfparams,mftype);

Plot the evaluation.


plot(x,y)
xlabel('gbellmf, P = [2 4 6]')

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trap
mf | trimf | zmf

dsigmf
Difference between two sigmoidal functions membership function
collapse all in page

Syntax
y = dsigmf(x,[a1 c1 a2 c2])

Description
The sigmoidal membership function used depends on the two parameters a and c and is
given by
(
)
f x;a,c =

a(xc)

11+e

The membership function dsigmf depends on four parameters, a1, c1, a2, and c2, and is the
difference between two of these sigmoidal functions.
f (x; a , c ) - f (x; a , c )
1

The parameters are listed in the order: [a c a c ].


1

Examples
collapse all

Obtain Difference of Two Sigmoidal Functions


Open This Example

x = 0:0.1:10;
y = dsigmf(x,[5 2 5 7]);
plot(x,y)
xlabel('dsigmf, P = [5 2 5 7]')

See Also
evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trapmf | trimf
| zmf

evalmf
Generic membership function evaluation
collapse all in page

Syntax
y = evalmf(x,mfParams,mfType)

Description

evalmf evaluates any membership function, where x is the variable range for the membership
function evaluation, mfType is a membership function from the toolbox, and mfParamsare
appropriate parameters for that function.
If you want to create your own custom membership function, evalmf still works, because it
evaluates any membership function whose name it does not recognize.

Examples
collapse all

Evaluate Membership Function


Open This Example

Evaluate a generalized bell-shaped membership function.


x = 0:0.1:10;
mfparams = [2 4 6];
mftype = 'gbellmf';
y = evalmf(x,mfparams,mftype);
Plot the evaluation.
plot(x,y)
xlabel('gbellmf, P = [2 4 6]')

See Also

dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trap
mf | trimf | zmf

gauss2mf
Gaussian combination membership function
collapse all in page

Syntax
y = gauss2mf(x,[sig1 c1 sig2 c2])

Description
The Gaussian function depends on two parameters sig and c as given by

(
)
f x;,c =e(xc)222
The function gauss2mf is a combination of two of these two parameters. The first function,
specified by sig1 and c1, determines the shape of the left-most curve. The second function
specified by sig2 and c2 determines the shape of the right-most curve. Whenever c1 < c2,
the gauss2mf function reaches a maximum value of 1. Otherwise, the maximum value is less than
one. The parameters are listed in the order:
[sig1, c1, sig2, c2] .

Examples
collapse all

Gaussian Combination Membership Functions


Open This Example

x = [0:0.1:10]';
y1 = gauss2mf(x,[2 4 1
y2 = gauss2mf(x,[2 5 1
y3 = gauss2mf(x,[2 6 1
y4 = gauss2mf(x,[2 7 1
y5 = gauss2mf(x,[2 8 1
plot(x,[y1 y2 y3 y4 y5])

8]);
7]);
6]);
5]);
4]);

See Also
dsigmf | evalmf | gauss2mf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trapmf | trimf |
zmf

gbellmf
Generalized bell-shaped membership function
collapse all in page

Syntax
y = gbellmf(x,params)

Description
The generalized bell function depends on three parameters a, b, and c as given by
(
)
f x;a,b,c =11+

2b
xca

where the parameter b is usually positive. The parameter c locates the center of the curve.
Enter the parameter vector params, the second argument for gbellmf, as the vector whose
entries are a, b, and c, respectively.

Examples

collapse all

Generalized Bell-Shaped Membership Function


Open This Example

x = 0:0.1:10;
y = gbellmf(x,[2 4 6]);
plot(x,y)
xlabel('gbellmf, P=[2 4 6]')

See Also
dsigmf | evalmf | gauss2mf | gaussmf | mf2mf | pimf | psigmf | sigmf | smf | trapmf | trimf
| zmf

mf2mf
Translate parameters between membership functions
collapse all in page

Syntax
outParams = mf2mf(inParams,inType,outType)

Description

This function translates any built-in membership function type into another, in terms of its parameter
set. In principle, mf2mf mimics the symmetry points for both the new and old membership
functions.

Caution Occasionally this translation results in lost information, so that if the output parameters are translated back into the original membership
the same as it did originally.

The input arguments for mf2mf are as follows:

inParams: the parameters of the membership function you are transforming

inType: a string name for the type of membership function you are transforming

outType: a string name for the new membership function you are transforming to

Examples
collapse all

Translate Parameters Between Membership Functions


Open This Example

x = 0:0.1:5;
mf1 = [1 2 3];
mf2 = mf2mf(mf1,'gbellmf','trimf');
plot(x,gbellmf(x,mf1),x,trimf(x,mf2))
legend('Generalized bell-shaped','Triangle-shaped','Location','South')
ylim([-0.05 1.05])

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | pimf | psigmf | sigmf | smf | trapmf | trimf
| zmf

pimf
-shaped membership function
collapse all in page

Syntax
y = pimf(x,[a b c d])

Description
This spline-based curve is so named because of its shape. The membership function is evaluated
at the points determined by the vector x. The parameters a and d locate the "feet" of the curve,
while b and c locate its "shoulders." The membership function is a product
of smf and zmf membership functions, and is given by:

f(x;a,b,c,d)=
(
)2
(
)2
(
)
0,2
,12
,1,xa
bax
xbxc12
xaba

, cx

c+d2

xbba

(
2

)2

xddc

c+d2

a+b2

xd

a+b2

0,

Examples
collapse all

Pi-Shaped Membership Function


Open This Example

x = 0:0.1:10;
y = pimf(x,[1 4 5 10]);
plot(x,y)
xlabel('pimf, P = [1 4 5 10]')
ylim([-0.05 1.05])

See Also

xcdc

xd

dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | psigmf | sigmf | smf | trapmf | tri
mf

psigmf
Product of two sigmoidal membership functions
collapse all in page

Syntax
y = psigmf(x,[a1 c1 a2 c2])

Description
The sigmoid curve plotted for the vector x depends on two parameters a and c as given by

f(x;a,c)=

a(xc)

11+e

psigmf is simply the product of two such curves plotted for the values of the vector x
f1(x; a1, c1) f2(x; a2, c2)

The parameters are listed in the order [a1 c1 a2 c2].

Examples
collapse all

Product of Two Sigmoidal Membership Functions


Open This Example

x = 0:0.1:10;
y = psigmf(x,[2 3 -5 8]);
plot(x,y)
xlabel('psigmf, P = [2 3 -5 8]')
ylim([-0.05 1.05])

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | sigmf | smf | trapmf | trimf
| zmf

sigmf
Sigmoidal membership function
collapse all in page

Syntax
y = sigmf(x,[a c])

Description
The sigmoidal function, sigmf(x,[a c]), as given in the following equation by f(x,a,c) is a
mapping on a vector x, and depends on two parameters a and c.

(
)
f x,a,c =

a(xc)
11+e

Depending on the sign of the parameter a, the sigmoidal membership function is inherently
open to the right or to the left, and thus is appropriate for representing concepts such as
"very large" or "very negative." More conventional-looking membership functions can be
built by taking either the product or difference of two different sigmoidal membership
functions. For more information see dsigmf and psigmf.

Examples
collapse all

Sigmoidal Membership Function


Open This Example

x = 0:0.1:10;
y = sigmf(x,[2 4]);
plot(x,y)
xlabel('sigmf, P = [2 4]')
ylim([-0.05 1.05])

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trap
mf | trimf | zmf

smf
S-shaped membership function
collapse all in page

Syntax
y = smf(x,[a b])

Description
This spline-based curve is a mapping on the vector x, and is named because of its S-shape.
The parameters a and b locate the extremes of the sloped portion of the curve, as given by:
(
f(x;a,b)=0,2

xaba

a+b2

xbb

Examples
collapse all

S-Shaped Membership Function


Open This Example

x = 0:0.1:10;
y = smf(x,[1 8]);
plot(x,y)
xlabel('smf, P = [1 8]')
ylim([-0.05 1.05])

)2

(
,12

)2
xbba

,1,xa

a+b2

xa

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trap
mf | trimf | zmf

trapmf
Trapezoidal-shaped membership function
collapse all in page

Syntax
y = trapmf(x,[a b c d])

Description
The trapezoidal curve is a function of a vector, x, and depends on four scalar parameters a, b, c,
and d, as given by

(
)
f x;a,b,c,d =0,

xaba

,1,

dxdc

,0,xabcd

axbxcxdx
or, more compactly, by

(
)
(
(
f x;a,b,c,d =max min

xaba

,1,

) )
,o

dxdc

The parameters a and d locate the "feet" of the trapezoid and the parameters b and c locate the
"shoulders."

Examples
collapse all

Trapezoid-Shaped Membership Function


Open This Example

x = 0:0.1:10;
y = trapmf(x,[1 5 7 8]);
plot(x,y)
xlabel('trapmf, P = [1 5 7 8]')
ylim([-0.05 1.05])

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trimf
| zmf

trimf
Triangular-shaped membership function
collapse all in page

Syntax
y = trimf(x,[a b c])

Description
The triangular curve is a function of a vector, x, and depends on three scalar parameters a, b,
and c, as given by

(
)
f x;a,b,c =0,
x

xaba cxcb

,0,xabcaxbxc

or, more compactly, by

(
)
(
(
f x;a,b,c =max min

) )
,o

xaba cxcb

The parameters a and c locate the "feet" of the triangle and the parameter b locates the peak.

Examples
collapse all

Triangle-Shaped Membership Function


Open This Example

x = 0:0.1:10;
y = trimf(x,[3 6 8]);
plot(x,y)
xlabel('trimf, P = [3 6 8]')
ylim([-0.05 1.05])

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trap
mf

zmf
Z-shaped membership function
collapse all in page

Syntax
y = zmf(x,[a b])

Description
This spline-based function of x is so named because of its Z-shape. The parameters a and b locate
the extremes of the sloped portion of the curve as given by.

(
)
(
f x;a,b =1,12
x

a+b2

xbb

xaba

)2 (
,2

)2
xbba

,0,xa

a+b2

xa

Examples
collapse all

Z-Shaped Membership Function


Open This Example

x = 0:0.1:10;
y = zmf(x,[3 7]);
plot(x,y)
xlabel('zmf, P = [3 7]')
ylim([-0.05 1.05])

See Also
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | pimf | psigmf | sigmf | smf | trap
mf | trimf

Das könnte Ihnen auch gefallen