Implement Union, Intersection, Complement and Difference Operations of Fuzzy Set Using Python
Implement Union, Intersection, Complement and Difference Operations of Fuzzy Set Using Python
import numpy as np
# Perform union
union = np.fmax(mA, mB)
# Perform intersection
intersection = np.fmin(mA, mB)
# Perform complement
complementA = 1 - mA
# Perform difference
difference = np.fmax(mA - mB, np.zeros_like(x))
plt.figure(figsize=(10, 8))
plt.legend(loc="upper right")
plt.show()
Output: