0

I need to plot Interval Type-2 Fuzzy Membership function.

Please help how to get this kind of plot:

this kind of plot

Laleh
  • 488
  • 4
  • 16
thevobot
  • 23
  • 7
  • Could you please add either mathematics formula or a description of what you are planning to draw! – Laleh Jun 16 '17 at 09:14
  • In x-y plane, these are 2 Gaussians, one above the another, which can be understood by the shape and along the z, all have the same value of 1 for the points 0 to 1. – thevobot Jun 16 '17 at 09:31

1 Answers1

0

I don't have statistics toolbox so I generate the Gaussian pdfs. If you do, you can write the first part of the code in one line.

x = [-3:.1:3];
% Create the x Gaussian distribution
sigma1 = 1;
mu1=0;
normpdf1 = 1/(sigma1*sqrt(2*pi)) * exp(-(x-mu1).^2/(2*sigma1^2));
% Create the y Gaussian distribution
sigma2 = 2;
mu2=0;
normpdf2 = 1/(sigma2*sqrt(2*pi)) * exp(-(x-mu2).^2/(2*sigma2^2));

height = 2; % height in Z direction is the same for all points

for i=1:length(normpdf1)

    len = normpdf2(i)/2;
    xdata = [x(i) x(i) x(i) x(i)];
    ydata = [normpdf1(i)- len normpdf1(i)- len normpdf1(i)+ len 
    normpdf1(i)+ len];
    zdata = [0 height  height 0];

    patch('Xdata',xdata, 'Ydata',ydata, 'Zdata',zdata, 'FaceColor', 'red')
    hold on
end
Laleh
  • 488
  • 4
  • 16