%% Compute Probabilistic OR Between Two Membership Functions
% Define the universe of discourse (input values) for the membership functions.

x = 0:0.1:10;

% Define two Gaussian membership functions with different means and variances.

y1 = gaussmf(x,[0.5 4]);
y2 = gaussmf(x,[2 7]);

% Compute the probabilistic OR between these membership functions.

y = probor([y1;y2]);

% Plot the results.

plot(x,[y1;y2;y])
legend('y1','y2','y')
ylim([-0.05 1.05])
ylabel('Membership')
xlabel('Input Value')

% Copyright 2019 The MathWorks, Inc.