Confused about skfuzzy trimf() not having values for negative x

61 views Asked by At

I am studying for a fuzzy logic exam and this question came up for the past papers

import numpy as np
import skfuzzy as fuzz
import matplotlib.pyplot as plt

X = np.arange(-100, 100, 1)
A = fuzz.trimf(X, [-50, 5, 30])
B = fuzz.trapmf(X, [-110, -100,-50,100])
C = fuzz.gaussmf(X, 0, 30)
D = fuzz.gauss2mf(X, -10, 5, 10, 30)

plt.plot(A)
plt.plot(B)
plt.plot(C)
plt.plot(D)

The question is to sketch the graphs of the above functions. If I run the code I get the following output. But X = [-100, 100). So isn't the image wrong? Like, it's shifted to the right by 100. Specially C is supposed to be centered at (have a mean of) 0 right?

Fuzzy output

0

There are 0 answers