showrule

Display Fuzzy Inference System rules

Syntax

showrule(fis)
showrule(fis,indexList)
showrule(fis,indexList,format)
showrule(fis,indexList,format,Lang)

Description

This command is used to display the rules associated with a given system. It can be invoked with one to four arguments. The first argument, fis, is required. This argument is the MATLAB® workspace variable name for a FIS structure. The second (optional) argument indexList is the vector of rules you want to display. The third argument (optional) is the string representing the format in which the rules are returned. showrule can return the rule in any of three different formats: 'verbose' (the default mode, for which English is the default language), 'symbolic', and 'indexed', for membership function index referencing.

When used with four arguments, the forth argument must be verbose, and showrule(fis,indexList,format,Lang) displays the rules in the language given by lang, which must be either 'english', 'francais', or 'deutsch'.

Examples

a = readfis('tipper');
showrule(a,1)
ans =
1. If (service is poor) or (food is rancid)
   then (tip is cheap) (1)

showrule(a,2)
ans =
2. If (service is good) then (tip is average) (1)

showrule(a,[3 1],'symbolic')
ans =
3. (service==excellent) | (food==delicious) => 
   (tip=generous) (1)
1. (service==poor) | (food==rancid) => (tip=cheap) (1)

showrule(a,1:3,'indexed')
ans =
1 1, 1 (1) : 2
2 0, 2 (1) : 1
3 2, 3 (1) : 2
Was this topic helpful?