Main Content

Triangular MF

Triangular membership function

  • Triangular MF block

Libraries:
Fuzzy Logic Toolbox / Membership Functions

Description

The Triangular MF block implements a triangle-shaped membership function.

f(x;a,b,c)={0,xaxaba,axbcxcb,bxc0,cx}

More compactly, the function is as follows.

f(x;a,b,c)=max(min(xaba,cxcb),0)

The parameters a and c set the left and right feet or base points of the triangle. The parameter b sets the location of the triangle peak.

This block is related to the Trapezoidal MF, Linear S-shaped MF, and Linear Z-shaped MF blocks.

Ports

Input

expand all

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

Output

expand all

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

Parameters

expand all

Left foot a of the triangle.

Programmatic Use

Block Parameter: a
Type: string, character vector
Default: "1"

Triangle peak b.

Programmatic Use

Block Parameter: b
Type: string, character vector
Default: "3"

Right foot c of the triangle.

Programmatic Use

Block Parameter: c
Type: string, character vector
Default: "6"

Extended Capabilities

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

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Version History

Introduced before R2006a