Accelerating the pace of engineering and science

# zmf

Z-shaped membership function

## Syntax

```y = zmf(x,[a b])
```

## Description

This spline-based function of x is so named because of its Z-shape. The parameters a and b locate the extremes of the sloped portion of the curve as given by.

$f\left(x;a,b\right)=\left\{\begin{array}{cc}1,& x\le a\\ 1-2{\left(\frac{x-a}{b-a}\right)}^{2},& a\le x\le \frac{a+b}{2}\\ \text{2}{\left(\frac{x-b}{b-a}\right)}^{\text{2}},& \frac{a+b}{2}\le x\le b\\ 0,& x\ge b\end{array}$

## Examples

expand all

### Z-Shaped Membership Function

```x = 0:0.1:10;
y = zmf(x,[3 7]);
plot(x,y)
xlabel('zmf, P=[3 7]')
ylim([-0.05 1.05])
```