Fuzzy Logic Toolbox: Learning Rules with 'OR' connection
6 views (last 30 days)
Show older comments
Hi Community,
I have been experimenting on fuzzy logic system auto tuning. I found the 'learning' option provided by the toolbox seems only generating rules with 'AND' connection. The 'tuning' option also does not allow me to optimise the connection type between 'AND' and 'OR'.
Is this "learning with 'OR'" functionality not implemented on purpose? Is there a workaround to enable this?
I have read the following documentation webpages:
Best,
Daniel
0 Comments
Answers (1)
Umar
on 27 Jun 2024
Hi Daniel,
for implementing 'OR' connections in the fuzzy logic system auto-tuning process, a potential workaround involves customizing the rule generation or tuning process. This customization can be achieved by manually defining rules with 'OR' connections based on the specific requirements of the system.
Let's consider a hypothetical scenario where we want to incorporate 'OR' connections in the fuzzy logic system. We can create custom rules using the Mamdani fuzzy inference system in MATLAB. Below is a simplified example demonstrating how to define rules with 'OR' connections:
% Define input variables
input = [0 10 20 30 40]; output = [0 1 2 3 4];
% Create fuzzy input/output membership functions
fis = mamfis('Name','customFIS');
fis = addInput(fis,[0 40],'Name','input1',input);
fis = addOutput(fis,[0 4],'Name','output1',output);
% Define custom rules with 'OR' connections
rule1 = "If input1 is 10 or input1 is 20 then output1 is 1";
rule2 = "If input1 is 30 or input1 is 40 then output1 is 4";
% Add rules to the fuzzy inference system
fis = addRule(fis,rule1);
fis = addRule(fis,rule2);
% Evaluate the fuzzy inference system
evalfis([20],fis)
By manually specifying rules with 'OR' connections as shown in the example above, you can introduce the desired logic into the fuzzy system. This approach allows for greater flexibility and customization in rule generation, enabling you to tailor the system to your specific needs.
Hope that answers your question.
2 Comments
Umar
on 27 Jun 2024
Hi Daniel,
Glad to help out. Let me know if you need further assistance or help. Good luck with your future endeavors.
See Also
Categories
Find more on Fuzzy Logic Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!