Code For Matlab Program

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

CODE FOR MATLAB PROGRAM

% ===========================

% Filename :FUZZY_WASHING_MACHINE_U_WASH.m

% ===========================

echo on;

% ====================================================================

% A Fuzzy Expert System for determine washing time, spinning speed and cleanliness of washing
machine:

% (27-rule system)

% ====================================================================

%==========================================================================
======

% Problem: When one uses a washing machine, the person generally select the

% length of wash time based on the amount of load and the dirtiness of the clothes.

% To automate this process, sensors are used to detect the parameters. The wash time,

% cleanliness of the clothes and spinning speed are then determined from this data.

% =========================================================================

% Hit any key to load the fuzzy system.

pause

a=readfis('fuzzy washing machine U-wash.fis');

% Hit any key to display the whole system as a block diagram.

pause

figure('name','Block diagram of the fuzzy system of washing machine');

%%

% <<FILENAME.PNG>>

plotfis(a);

% Hit any key to display fuzzy sets for the input Type of dirt.
pause

figure('name','Weight of load');

plotmf(a,'input',1);

% Hit any key to display fuzzy sets for the input 2 Dirtness of clothes.

pause

figure('name','Dirtness of clothes');

plotmf(a,'input',2);

% Hit any key to display fuzzy sets for the input 3 Water level.

pause

figure('name','Amount of detergent');

plotmf(a,'input',3);

% Hit any key to display fuzzy sets for the input 4 Spin.

pause

ruleedit(a);

% Hit any key to generate three-dimensional plots for Rule Base.

pause

figure('name','Three-dimensional surface ');

gensurf(a,[1 2],1); view([49 36]);

% Hit any key to generate three-dimensional plots for Rule Base.

pause

figure('name','Three-dimensional surface ');

gensurf(a,[1 3],1); view([49 36]);

% Hit any key to bring up the Rule Viewer.

pause

ruleview(a);

echo off

disp('End of fuzzy_washing_machine_mamdani.m')
[System]
Name='fuzzy washing machine U-wash'
Type='mamdani'
Version=2.0
NumInputs=3
NumOutputs=3
NumRules=27
AndMethod='min'
OrMethod='max'
ImpMethod='min'
AggMethod='max'
DefuzzMethod='centroid'

[Input1]
Name='Weightofload'
Range=[0 1]
NumMFs=3
MF1='SMALL':'trimf',[-0.4 0 0.4]
MF2='MEDIUM':'trimf',[0.1 0.5 0.9]
MF3='LARGE':'trimf',[0.6 1 1.4]

[Input2]
Name='DirtynessofClothes'
Range=[0 1]
NumMFs=3
MF1='NON_GREASY':'trimf',[-0.4 0 0.4]
MF2='MEDIUM':'trimf',[0.1 0.5 0.9]
MF3='GREASY':'trimf',[0.6 1 1.4]

[Input3]
Name='Amountofdetergent'
Range=[0 1]
NumMFs=3
MF1='SMALL':'trimf',[-0.4 0 0.4]
MF2='MEDIUM':'trimf',[0.1 0.5 0.9]
MF3='LARGE':'trimf',[0.6 1 1.4]

[Output1]
Name='Spinningspeed'
Range=[0 1]
NumMFs=3
MF1='FAST':'trimf',[-0.4 0 0.4]
MF2='MEDIUM':'trimf',[0.1 0.5 0.9]
MF3='SLOW':'trimf',[0.6 1 1.4]

[Output2]
Name='Washingtime'
Range=[0 1]
NumMFs=3
MF1='SHORT':'trimf',[-0.4 0 0.4]
MF2='MEDIUM':'trimf',[0.1 0.5 0.9]
MF3='LONG':'trimf',[0.6 1 1.4]

[Output3]
Name='Cleanliness'
Range=[0 1]
NumMFs=3
MF1='LOW':'trimf',[-0.4 0 0.4]
MF2='MEDIUM':'trimf',[0.1 0.5 0.9]
MF3='HIGH':'trimf',[0.6 1 1.4]

[Rules]
1 1 1, 1 1 3 (1) : 1
1 2 1, 1 1 3 (1) : 1
1 3 1, 1 1 3 (1) : 1
1 1 2, 1 1 3 (1) : 1
1 2 2, 1 1 3 (1) : 1
1 3 2, 1 1 3 (1) : 1
1 1 3, 1 1 3 (1) : 1
1 2 3, 1 1 3 (1) : 1
1 3 3, 1 1 3 (1) : 1
2 1 1, 2 2 1 (1) : 1
2 2 1, 2 2 1 (1) : 1
2 3 1, 2 2 1 (1) : 1
2 1 2, 2 2 3 (1) : 1
2 2 2, 2 2 3 (1) : 1
2 3 2, 2 2 3 (1) : 1
2 1 3, 2 2 3 (1) : 1
2 2 3, 2 2 3 (1) : 1
2 3 3, 2 2 3 (1) : 1
3 1 1, 3 3 1 (1) : 1
3 2 1, 3 3 1 (1) : 1
3 3 1, 3 3 1 (1) : 1
3 1 2, 3 3 1 (1) : 1
3 2 2, 3 3 1 (1) : 1
3 3 2, 3 3 1 (1) : 1
3 1 3, 3 3 3 (1) : 1
3 2 3, 3 3 3 (1) : 1
3 3 3, 3 3 3 (1) : 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy