60 likes | 229 Views
Fuzzy Logic ToolKit Demo. Avishek Ghosh. After executing builder.sce and loader.sce. Trapezoidal Fuzzification. x=linspace(0,1,100)'; y1=trapmf(x,[0 0.2 0.4 0.6]); y2=trapmf(x,[0.2 0.5 0.6 0.9]); y3=trapmf(x,[0.5 0.6 0.8 0.9 ]); xbasc(); plot2d(x,[y1 y2 y3],leg="y1@y2@y3");
E N D
Fuzzy Logic ToolKit Demo Avishek Ghosh
Trapezoidal Fuzzification x=linspace(0,1,100)'; y1=trapmf(x,[0 0.2 0.4 0.6]); y2=trapmf(x,[0.2 0.5 0.6 0.9]); y3=trapmf(x,[0.5 0.6 0.8 0.9 ]); xbasc(); plot2d(x,[y1 y2 y3],leg="y1@y2@y3"); xtitle("Trapezoidal Member Function Example","x","mu(x)");
Functions Used • xbasc() - clear a graphics window and erase the associated recorded graphics • [v]=linspace(x1,x2 [,n]) – generates a row vector of n points between x1 and x2 • plot2d(x,y,leg) – x specifies the x-axis, y specifies the curves in the y-axis and leg provides the caption for the curves
DeFuzzification • x=linspace(0,1,100)'; • mf_value=max(0.6 * trapmf(x,[0 0.2 0.4 0.6]), 0.4 * trapmf(x,[0.2 0.5 0.6 0.9])); • y_centroide=defuzzm(x,mf_value,"centroide"); • disp(y_centroide); 0.3942120