putri
Newbie level 2
Hi, currently i am doing a project which required me to develop a fuzzy controller in mfiles. I have search online for some help and here is the rule's matrix use in the code. can anyone please explain to me how it works? and is it possible to write a rule matrix for two input single output? Thanks:-D
%rule set with one input variable, one output variable
d = [5 5]; % 5 input adj for Input fuzzy var ang,
% 5 output adj for output fuzzy var dz
% ang &? dz weight
% LN SN ZO SP LP LN SN ZO SP LP
rule=[ 1 0 0 0 0 1 1 0 0 0 0 1; % if ang is LN then dz is LN
0 1 0 0 0 1 0 1 0 0 0 1; % if ang is SN then dz is SN
0 0 1 0 0 1 0 0 1 0 0 1; % if ang is ZO then dz is ZO
0 0 0 1 0 1 0 0 0 1 0 1; % if ang is SP then dz is SP
0 0 0 0 1 1 0 0 0 0 1 1]; % if ang is LP then dz is LP
%rule set with one input variable, one output variable
d = [5 5]; % 5 input adj for Input fuzzy var ang,
% 5 output adj for output fuzzy var dz
% ang &? dz weight
% LN SN ZO SP LP LN SN ZO SP LP
rule=[ 1 0 0 0 0 1 1 0 0 0 0 1; % if ang is LN then dz is LN
0 1 0 0 0 1 0 1 0 0 0 1; % if ang is SN then dz is SN
0 0 1 0 0 1 0 0 1 0 0 1; % if ang is ZO then dz is ZO
0 0 0 1 0 1 0 0 0 1 0 1; % if ang is SP then dz is SP
0 0 0 0 1 1 0 0 0 0 1 1]; % if ang is LP then dz is LP