FUZZY_NOT

Computes the fuzzy NOT operator, representing the complement of a fuzzy set.

This essentially reflects the membership function along the horizontal axis at y=0.5 by subtracting each membership value from 1.

Excel Usage

=FUZZY_NOT(mfx)
  • mfx (list[list], required): Original fuzzy membership array defined on an independent universe.

Returns (list[list]): Complement membership array of the input function.

Example 1: Complement of mixed membership values

Inputs:

mfx
0.2 0.5 0.8 1

Excel formula:

=FUZZY_NOT({0.2,0.5,0.8,1})

Expected output:

Result
0.8
0.5
0.2
0
Example 2: Complement of a singleton fuzzy value

Inputs:

mfx
0.25

Excel formula:

=FUZZY_NOT(0.25)

Expected output:

0.75

Example 3: Complement preserves zero and one bounds

Inputs:

mfx
0 1

Excel formula:

=FUZZY_NOT({0,1})

Expected output:

Result
1
0
Example 4: Complement of a descending membership profile

Inputs:

mfx
1 0.75 0.25 0

Excel formula:

=FUZZY_NOT({1,0.75,0.25,0})

Expected output:

Result
0
0.25
0.75
1

Python Code

Show Code
import numpy as np
from skfuzzy import fuzzy_not as fuzz_not

def fuzzy_not(mfx):
    """
    Calculate the fuzzy NOT operator (complement) of a fuzzy set.

    See: https://pythonhosted.org/scikit-fuzzy/api/skfuzzy.html#skfuzzy.fuzzy_not

    This example function is provided as-is without any representation of accuracy.

    Args:
        mfx (list[list]): Original fuzzy membership array defined on an independent universe.

    Returns:
        list[list]: Complement membership array of the input function.
    """
    try:
        def to1d(arr):
            if isinstance(arr, list):
                flat = []
                for row in arr:
                    row_list = row if isinstance(row, list) else [row]
                    for val in row_list:
                        try:
                            flat.append(float(val))
                        except (TypeError, ValueError):
                            continue
                return np.array(flat)
            return np.array([float(arr)])

        mfx_arr = to1d(mfx)
        if len(mfx_arr) == 0:
            return "Error: Input mapped array mfx cannot be empty"

        result = fuzz_not(mfx_arr)
        return [[float(val)] for val in result]
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Original fuzzy membership array defined on an independent universe.