before procedding, it must be noted that the program i've made is just an example to give a demonstration how we can make it, the complexity of the program may depend upon the number of input variables, output variables & membership functions, although with the example of this program i've also attached a program file of MATLAB that i have made...
Step 1. open matlab & as shown u'll get the window screen
2. Since MATLAB comprises of so Much tools & applications, we will entirely focus on Fuzzy Logic Program, Go to Command Window & type - 'fuzzy' .
3. now as u Type 'fuzzy' on the command window. a new window appears as shown.this is the main working window of fuzzy's logic - where u'll set the input , output variables & their membership functions, as shown the input is processed & you get the output. Different inputs are processed to form different outputs
4.by selecting the edit>>add variable>>input , you can add different number of inputs and outputs, be default there is always 1 input and 1 output.
5. As an example, i have used the input variables as Food Quality & Service Quality in a Restaurent and the output variable as Tip to the waiter, as u simple know if the food quality is good and service is also good then obviously the Tip Should be high, Now based upon this we will define and make our program.
RENAME the input & output variables by clicking on them and then renaming as shown.
6.Now we have to edit membership functions of the input and output variables as shown under Edit>>Membership Functions.
7. the following window appears, where we will set the marginal values of our variables.
8. By setting the value of the parameters of the functions you can set the plots of the membership functions or you can simply adjust the plot by dragging it with the cursor.
9.change of the plots shown by changing the parameters.
10. You can also set names for your functional plots.
11. you can also add custom membership functions for the input and output variables, by default no. of custom membership functions plots are three.
12. After editing the membership plots we have to set the rules according to our input and output variables as explained earlier, rules can be set under edit>>rules.
13. Following is the rule editor in which the rules are set as required, by selecting the specific imputs and outputs the rules are added by clicking on 'add rule'
14. after editing the rules and the membership function plots all you have to do is to save the program by exporting/saving it on to your disk.
15.After saving the program you can view it under view>>rules for its result and analyse its plot under view>>surface.
as shown by changing the red bar you will see the results of the program will change dramatically so that you can analyse the output and by surface viewer you can analyse it.
if you have saved your program you can open it by importing into the MATLAB fuzzy toolbox and then you can edit it too by selecting Import << from file.
Below are the few screenshots of the program i have made it must be noted that above tutorial is to make you somewhat clear about how the program is made, Higher the no. of rules , input and output variables higher is the complexity of the program.
Main Program :
Rule Viewer :
Rule Editor :
Technically there might be some sort of error in the program but its all about the Fuzzy logic Program in MATALAB, Hope it helps...
No comments:
Post a Comment