functionrampmf

Bounded ramp membership function

Extends from BusinessSimulation.Icons.Function (Icon for functions).

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

Inputs

TypeNameDefaultDescription
RealxInput value for which the degree of membership is to be computed
RealaLower bound
RealbUpper bound

Outputs

TypeNameDefaultDescription
RealyDegree of membership