smf

S-shaped membership function

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The function returns the degree of membership using a S-shaped function given the real input x and the parameters foot a and shoulder b of the function.

Implementation


  y := if x <= a then 0
    elseif a < x and x <= midpoint then 2 * ( (x-a)/(b-a) )^2
    elseif midpoint < x and x <= b then 1 - 2 * ( (x-b)/(b-a) )^2
    else 1;

Syntax

Functions.smf(x, a, b);

Examples


Functions.smf( 5, a=2, b=8); // 0.5 Functions.smf( 1, a=2, b=8); // 0.0 Functions.smf( 9, a=2, b=8); // 1.0

See also

evalmf, rampmf, trimf, trapmf, sigmf, pimf, psigmf, gaussmf, gbellmf

Syntax

y = smf(x, a, b)

Inputs (3)

x

Type: Real

Description: Input value for which the degree of membership is to be computed

a

Type: Real

Description: Foot of the function (i.e., f(a) = 0)

b

Type: Real

Description: Shoulder of the function (i.e., f(b) = 1)

Outputs (1)

y

Type: Real

Description: Degree of membership