Contenido principal

pimf

R2026b

Pi-shaped membership function

Description

This function computes fuzzy membership values using a spline-based pi-shaped membership function. You can also compute this membership function using a fismf object. For more information, see fismf Object.

This membership function is related to the smf and zmf membership functions.

y = pimf(x,params) returns fuzzy membership values computed using a spline-based pi-shaped membership function. This membership function is the product of an smf function and a zmf function, and is given by:

f(x;a,b,c,d)={0,x≤a2(x−ab−a)2,a≤x≤a+b21−2(x−bb-a)2,a+b2≤x≤b1,b≤x≤c1−2(x−cd−c)2,c≤x≤c+d22(x−dd-c)2,c+d2≤x≤d0,x≥d}

To define the membership function parameters, specify params as the vector [a b c c].

Membership values are computed for each input value in x.

example

Examples

collapse all

Specify input values across the universe of discourse.

x = 0:0.1:10;

Evaluate membership function for the input values.

y = pimf(x,[1 4 5 10]);

Plot the membership function.

plot(x,y)
xlabel("x")
ylabel("Degree of Membership")
ylim([-0.05 1.05])

A smooth curve rising from zero at x = 1, flattening into a broad plateau with membership 1 from x = 4 to x = 5, then smoothly decreasing back to zero at x = 10.

Input Arguments

collapse all

Input values for which to compute membership values, specified as a scalar or vector.

Membership function parameters, specified as the vector [a b c d]. Parameters a and d define the feet of the membership function, and b and c define its shoulders.

Output Arguments

collapse all

Membership value returned as a scalar or a vector. The dimensions of y match the dimensions of x. Each element of y is the membership value computed for the corresponding element of x.

Alternative Functionality

fismf Object

You can create and evaluate a fismf object that implements the pimf membership function.

mf = fismf("pimf",P);
Y = evalmf(mf,X);

Here, X, P, and Y correspond to the x, params, and y arguments of pimf, respectively.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

expand all