Main Content

zmf

Z-shaped membership function

Description

This function computes fuzzy membership values using a spline-based Z-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 pimf membership functions.

y = zmf(x,params) returns fuzzy membership values computed using the spline-based Z-shaped membership function given by:

f(x;a,b)={1,xa12(xaba)2,axa+b22(xbb-a)2,a+b2xb0xb

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

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 = zmf(x,[3 7]);

Plot the membership function.

plot(x,y)
title('zmf, P = [3 7]')
xlabel('x')
ylabel('Degree of Membership')
ylim([-0.05 1.05])

Figure contains an axes object. The axes object with title zmf, P = [3 7], xlabel x, ylabel Degree of Membership contains an object of type line.

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]. Parameter a defines the shoulder of the membership function, and b defines its foot.

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 zmf membership function.

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

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

Extended Capabilities

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

Version History

Introduced before R2006a

expand all