rampmf

Bounded ramp 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 bounded ramp function given the real input x and the parameters lower bound a and upper bound b.

The ramp will usually ramp up from 0 to 1, but if lower bound and upper bound are switched (i.e., a > b), then the ramp will be ramp downwards from 1 to 0.

Implementation


y := max(min((x - a) / (b - a), 1), 0);

Syntax

Functions.rampmf(x, a, b);

Examples


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

See also

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

Syntax

y = rampmf(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: Lower bound

b

Type: Real

Description: Upper bound

Outputs (1)

y

Type: Real

Description: Degree of membership