problem avec FIS et ANFIS
Bonjour tous,
bon je veux créer un neuro-fuzzy system ,qui fait la classification des etudiants etant {bad,good,very good, excellent},j'ai commencer par créer un FIS et voila le code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
a=newfis('class_student');
%%%%%%%%%%%%%%%%%%%%%%--First input--%%%%%%%%%%%%%%%%%%%%%%%%%
a.input(1).name='score';
a.input(1).range=[0 100];
%---------------%
a.input(1).mf(1).name='bad';
a.input(1).mf(1).type='trapmf';
a.input(1).mf(1).params=[-22 -20 20 22];
%---------------%
a.input(1).mf(2).name='low';
a.input(1).mf(2).type='trapmf';
a.input(1).mf(2).params=[20 22 40 42];
%---------------%
a.input(1).mf(3).name='medium';
a.input(1).mf(3).type='trapmf';
a.input(1).mf(3).params=[40 42 80 82];
%---------------%
a.input(1).mf(4).name='high';
a.input(1).mf(4).type='highmf';
a.input(1).mf(4).params=[80 82 120 140];
%%%%%%%%%%%%%%%%%%%%%%--Second input--%%%%%%%%%%%%%%%%%%%%%%%%%%
a.input(2).name='speed';
a.input(2).range=[0 120];
%---------------%
a.input(2).mf(1).name='fast';
a.input(2).mf(1).type='trapmf';
a.input(2).mf(1).params=[-25 -20 20 25];
%---------------%
a.input(2).mf(2).name='moderate';
a.input(2).mf(2).type='trapmf';
a.input(2).mf(2).params=[20 25 35 40];
%---------------%
a.input(2).mf(3).name='slow';
a.input(2).mf(3).type='trapmf';
a.input(2).mf(3).params=[35 40 120 140];
%%%%%%%%%%%%%%%%%%%%%%%--First output--%%%%%%%%%%%%%%%%%%%%%%%%%
a.output(1).name='class';
a.output(1).range=[0 30];
%---------------%
a.output(1).mf(1).name='bad'
a.output(1).mf(1).type='trimf';
a.output(1).mf(1).params=[0 5 10];
%---------------%
a.output(1).mf(2).name='good';
a.output(1).mf(2).type='trimf';
a.output(1).mf(2).params=[10 15 20];
%---------------%
a.output(1).mf(3).name='very good';
a.output(1).mf(3).type='trimf';
a.output(1).mf(3).params=[20 25 30];
%---------------%
a.output(1).mf(4).name='excellent'
a.output(1).mf(4).type='trimf';
a.output(1).mf(4).params=[0 5 10];
%%%%%%%%%%%%%%%%%%%%%%%%--Rules--%%%%%%%%%%%%%%%%%%%%%%%
a.rule(1).antecedent=[1 3];
a.rule(1).consequent=[1];
a.rule(1).weight=1;
a.rule(1).connection=2;
%---------------%
a.rule(2).antecedent=[1 2];
a.rule(2).consequent=[1];
a.rule(2).weight=1;
a.rule(2).connection=1;
%---------------%
a.rule(3).antecedent=[1 1];
a.rule(3).consequent=[1];
a.rule(3).weight=1;
a.rule(3).connection=2
%---------------%
a.rule(4).antecedent=[2 3];
a.rule(4).consequent=[1];
a.rule(4).weight=1;
a.rule(4).connection=2
%---------------%
a.rule(5).antecedent=[2 2];
a.rule(5).consequent=[2];
a.rule(5).weight=1;
a.rule(5).connection=2
%---------------%
a.rule(6).antecedent=[2 1];
a.rule(6).consequent=[2];
a.rule(6).weight=1;
a.rule(6).connection=2
%---------------%
a.rule(7).antecedent=[3 3];
a.rule(7).consequent=[2];
a.rule(7).weight=1;
a.rule(7).connection=2
%---------------%
a.rule(8).antecedent=[3 2];
a.rule(8).consequent=[3];
a.rule(8).weight=1;
a.rule(8).connection=2
%---------------%
a.rule(9).antecedent=[1 1];
a.rule(9).consequent=[1];
a.rule(9).weight=1;
a.rule(9).connection=2
%---------------%
a.rule(10).antecedent=[4 3];
a.rule(10).consequent=[3];
a.rule(10).weight=1;
a.rule(10).connection=2
%---------------%
a.rule(11).antecedent=[4 2];
a.rule(11).consequent=[4];
a.rule(11).weight=1;
a.rule(11).connection=2
%---------------%
a.rule(12).antecedent=[4 1];
a.rule(12).consequent=[4];
a.rule(12).weight=1;
a.rule(12).connection=2
%---------------% |
normalement la c'est bon j'ai un fis mais quand je tappe
Code:
showfis('class_student')
je recois
Code:
1 2 3 4
| ??? Attempt to reference field of non-structure array.
Error in ==> showfis at 42
NumRules=length(fis.rule); |
Pourquoi?
et pour realiser le ANFIS j'ai lu que c'est reservé pour les FIS de type Sugeno et ce type n'a une output,est ce que cela veut dire que je ne peux pas utiliser le ANFIS pour mon probleme?
et merci d'avance