View source: R/FuzzyNumbersToMatrix.R
FuzzyNumbersToMatrix | R Documentation |
'FuzzyNumbersToMatrix' converts a list of triangular or trapezoidal fuzzy numbers into a matrix.
FuzzyNumbersToMatrix(fuzzyList, trapezoidal = TRUE, varNames = NA, ...)
fuzzyList |
Name of the list with fuzzy numbers. |
trapezoidal |
Logical value depending on the type of fuzzy values (triangular or trapezoidal ones). |
varNames |
Optional names for columns of the output matrix. |
... |
Additional parameters passed to other functions. |
The procedure converts the given list of triangular or trapezoidal fuzzy numbers into a matrix.
It is necessary to select the appropriate type of these fuzzy numbers (using trapezoidal=FALSE
for
triangular fuzzy
numbers or the default trapezoidal=TRUE
for trapezoidal ones)
The output matrix has 3 (for triangular fuzzy numbers)
or 4 (for trapezoidal ones) columns with the values of the left supports, cores (or the left and right ends of the cores for trapezoidal fuzzy
cores) and right supports.
Each row is related to single fuzzy number.
The output is given as a matrix with 3 (for triangular fuzzy numbers) or 4 (for trapezoidal ones) columns and the number of rows is equal to number of fuzzy values.
MatrixToFuzzyNumbers
for conversion of a matrix to fuzzy numbers
# seed PRNG
set.seed(1234)
# load the necessary library
library(FuzzySimRes)
# generate sample of trapezoidal fuzzy numbers with FuzzySimRes library
list1<-SimulateSample(20,originalPD="rnorm",parOriginalPD=list(mean=0,sd=1),
incrCorePD="rexp", parIncrCorePD=list(rate=2),
suppLeftPD="runif",parSuppLeftPD=list(min=0,max=0.6),
suppRightPD="runif", parSuppRightPD=list(min=0,max=0.6),
type="trapezoidal")
# check the first fuzzy number
list1$value[[1]]
# convert fuzzy numbers to a matrix and check the first value
head(FuzzyNumbersToMatrix(list1$value))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.