79622786

Date: 2025-05-15 07:00:42
Score: 1.5
Natty:
Report link

I do not have the Fuzzy Logic Toolbox available right now but if i remember correctly using the string rule syntax does not allow for multiple outputs so either you use the numerical syntax or you double up the rules so that each has to handle only one output.

Option 1, numerical:


rules = [
    2 2 2 2 1 1;
    1 2 1 1 1 1
];

FIS = addRule(FIS, rules);

Option 2, strings:

rule11 = "Risk==Severe & Deficiency==High => Condition2=Urgent (1)";
rule12 = "Risk==Severe & Deficiency==High => DeficiencyOutput=Severe (1)";
rule21 = "Risk==Moderate & Deficiency==High => Condition2=Priority (1)";
rule22 = "Risk==Moderate & Deficiency==High => DeficiencyOutput=Moderate (1)";

FIS = addRule(FIS, [rule11, rule12, rule21, rule22]);

As i said, i haven't tested (i may have some doubts with the numerical one cos it is not so intuitive to define as you can see) it but it should do it.

Reasons:
  • RegEx Blacklisted phrase (2): Urgent
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ferro Luca