Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Fuzzy Logic In Mfiles

Status
Not open for further replies.

putri

Newbie level 2
Joined
Mar 9, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
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
 

if you want write a rules for two input single output just Open the FIS Editor by typing fuzzy at the MATLAB prompt and add variable(input & output variables). after that open Edit menu and select Rules and create your rules. that's easy

save file(.fis) and connect with this in M-file if you want.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top