Learn R Programming

FuzzyToolkitUoN (version 1.0)

trapMF: Create a trapezoidal membership function.

Description

Creates a trapezoidal membership function object.

Usage

trapMF(mfName, x, mfParams)

Arguments

mfName
String representing the name of the membership function
x
The range of the membership function, such as 1:10
mfParams
The parameters, which should be a numeric vector of left foot, left shoulder, right shoulder, right foot and height.

Value

  • mfNameThe name of the membership function (String)
  • mfXA numeric vector representing the range of the variable.
  • mfParamsA numeric vector representing the given input parameters upon creation. These should be the left foot, left shoulder, right shoulder and height.
  • mfValsThe evaluated values for the membership function.

Details

To access the values: $mfParams for the stored parameters. $mfX for the stored range. $mfName for the stored name. $mfVals for the stored evaluated values. Where is the assigned name of the membership function in the environment.

Examples

Run this code
myMembershipFunction <- trapMF("NameOfMembershipFunction", 1:10, c(1,2,4,5,1))

Run the code above in your browser using DataLab