# prepare some fuzzy numbers (first type of the initial sample)
fuzzyValues <- matrix(c(0.25,0.5,1,1.25,0.75,1,1.5,2.2,-1,0,0,2),ncol = 4,byrow = TRUE)
# calculate the mid/spread distance between the first value
# (from the first row) and the second one (from the second row)
BertoluzzaDistance(fuzzyValues[1,],fuzzyValues[2,])
# calculate the mid/spread distance between the first value
# (from the first row) and all of the values (from the first to the third row)
BertoluzzaDistance(fuzzyValues[1,],fuzzyValues)
Run the code above in your browser using DataLab