Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Fuzzy Logic Toolbox Rules

Subject: Fuzzy Logic Toolbox Rules

From: Ashley Ee

Date: 3 Dec, 2009 02:52:03

Message: 1 of 2

I'm trying to use the fuzzy logic toolbox and my fuzzy system has 24 inputs.

I'm running into a bit of confusion when it comes to me creating the rules list now for the addrule function. My rules are actually quite simple. I have two specific cases, and one else case. However, it appears to me that there is no way to write the else case?

This becomes a bit daunting in that for 24 inputs, I'm going to have to write out every single combination of membership functions for these 24 inputs. Which is a huge, huge number. (i.e. Millions of lines of rules)

Surely there is a more sane way to implement the rules list in the fuzzy logic toolbox? Can any one point me in the right direction for this? I tried looking at the parsrule function, but I can only seem to get it to add one rule. Any subsequent rule I add seems to overwrite the first one? But even then, would this give me the ability to have a generic single line else type of rule? (Would A or B or C or D, etc work?)

Any thoughts are greatly appreciated...

Subject: Fuzzy Logic Toolbox Rules

From: Arkadiy Turevskiy

Date: 18 Dec, 2009 17:14:04

Message: 2 of 2

Hi Ashley,
It seems like you should be able to define your rules with addrule function. Do you really have millions of rules for your 24 input variables? Can't you write a script that will generate the rule matrix for you if you have just a few rules as you say?

Also, you should be able to describe the "else" rule, using "not" operation.

For example, for a simple case with 2 inputs and 1 output, where each input has 3 membership functions, and output has 2 MFs let's say the rules are:
if (input 1 is MF1) and (input 2 is MF1) then (output is MF1),
else (Output is MF2).

else rule means:
if (input 1 is not MF1) or (input 2 is not MF2) then (output is MF2)

You can do that with this matrix:
[ 1 1 1 1 1;
-1 -1 2 1 2];

HTH.
Arkadiy




"Ashley Ee" <ee.ashley@gmail.com> wrote in message <hf794j$dfl$1@fred.mathworks.com>...
> I'm trying to use the fuzzy logic toolbox and my fuzzy system has 24 inputs.
>
> I'm running into a bit of confusion when it comes to me creating the rules list now for the addrule function. My rules are actually quite simple. I have two specific cases, and one else case. However, it appears to me that there is no way to write the else case?
>
> This becomes a bit daunting in that for 24 inputs, I'm going to have to write out every single combination of membership functions for these 24 inputs. Which is a huge, huge number. (i.e. Millions of lines of rules)
>
> Surely there is a more sane way to implement the rules list in the fuzzy logic toolbox? Can any one point me in the right direction for this? I tried looking at the parsrule function, but I can only seem to get it to add one rule. Any subsequent rule I add seems to overwrite the first one? But even then, would this give me the ability to have a generic single line else type of rule? (Would A or B or C or D, etc work?)
>
> Any thoughts are greatly appreciated...

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us