To plot various membership functions > Matlab

To plot various membership functions ( triangular, trapezoidal and bell shaped ) > Matlab

Soft Computing


%Triangular Membership function
x=(0.0:1.0:10.0)';
y1=trimf(x,[1 3 5]);
subplot(311)
plot(x,[y1]);

%Trapezoidal Membership function
x=(0.0:1.0:10.0)';
y1=trapmf(x,[1 3 5 7]);
subplot(312)
plot(x,[y1]);

%Bell Shaped Membership function
y1=gbellmf(x,[1 2 5])';
subplot(313)
plot(x,[y1]);


OUTPUT :

Comments

Popular posts from this blog

Intermediate Code Generation > C Program