Reviews & Opinions
Independent and trusted. Read before buy Matlab Fuzzy Logic Toolbox 2!

Matlab Fuzzy Logic Toolbox 2


Bookmark
Matlab Fuzzy Logic Toolbox 2

Bookmark and Share

 

Matlab Fuzzy Logic Toolbox 2About Matlab Fuzzy Logic Toolbox 2
Here you can find all about Matlab Fuzzy Logic Toolbox 2 like manual and other informations. For example: review.

Matlab Fuzzy Logic Toolbox 2 manual (user guide) is ready to download for free.

On the bottom of page users can write a review. If you own a Matlab Fuzzy Logic Toolbox 2 please write about it to help other people.
[ Report abuse or wrong photo | Share your Matlab Fuzzy Logic Toolbox 2 photo ]

 

 

Manual

Download (English)

 

Matlab Fuzzy Logic Toolbox 2

 

 

User reviews and opinions

<== Click here to post a new opinion, comment, review, etc.

Comments to date: 7. Page 1 of 1. Average Rating:
Kit 9:34am on Thursday, September 16th, 2010 
Why would someone want a 4g, which has awful reception issues and features a second cam which is useless without wifi? or a 3gs.
x8jjth 7:59am on Thursday, September 16th, 2010 
iphone is the cats ass of the cell phone buis.. easily the best ! To me, it looks like Blackberry is for a serious, adult, mature user whereas the iPhone is for those who just want to look and feel young.
kmp 1:54am on Sunday, July 11th, 2010 
The latest and most famed phone currently. This phone is very different from other phones. This is an outstanding phone with many features. As one of the biggest Electronic producer, Apple launch the new generation of I Phone, that is apple I Phone 3G. As we know together.
S29K 11:41pm on Sunday, May 16th, 2010 
With fast 3G technology for mobile environments, Maps with GPS, support for enterprise features like Microsoft Exchange and the new AppStore.
Gwygory 3:37pm on Sunday, May 2nd, 2010 
Excellent map graphics and user interface. I will give 4 star on it.This is REAL personal navigation application. Just the best phone I have ever owned! Great user interface..Excellent web browser. Multi-touch works great and the app store rocks None
Niromop13 8:04pm on Sunday, April 25th, 2010 
Lighter design, thinner feel Battery with 3G enabled is less than a day with average use as compared to 2 days with edge on previous phone
mogliii 8:42am on Friday, April 16th, 2010 
I bought an iPhone just after my friend told me about this website. iPhone works like my personal assistant. Great price too. I love it.

Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.

 

Documents

doc0

Fuzzy Logic Toolbox 2 Users Guide

How to Contact MathWorks

Web Newsgroup www.mathworks.com/contact_TS.html Technical Support
www.mathworks.com comp.soft-sys.matlab suggest@mathworks.com bugs@mathworks.com doc@mathworks.com service@mathworks.com info@mathworks.com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Fuzzy Logic Toolbox Users Guide COPYRIGHT 19952011 The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the governments needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc.

Trademarks

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.

Patents

MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information.

Revision History

January 1995 April 1997 January 1998 September 2000 April 2003 June 2004 March 2005 September 2005 March 2006 September 2006 March 2007 September 2007 March 2008 October 2008 March 2009 September 2009 March 2010 September 2010 April 2011
First printing Second printing Third printing Fourth printing Fifth printing Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only
Revised for Version 2 (Release 12) Updated for Version 2.1.3 (Release 14) Updated for Version 2.2.1 (Release 14SP2) Updated for Version 2.2.2 (Release 14SP3) Updated for Version 2.2.3 (Release 2006a) Updated for Version 2.2.4 (Release 2006b) Updated for Version 2.2.5 (Release 2007a) Revised for Version 2.2.6 (Release 2007b) Revised for Version 2.2.7 (Release 2008a) Revised for Version 2.2.8 (Release 2008b) Revised for Version 2.2.9 (Release 2009a) Revised for Version 2.2.10 (Release 2009b) Revised for Version 2.2.11 (Release 2010a) Revised for Version 2.2.12 (Release 2010b) Revised for Version 2.2.13 (Release 2011a)

Contents

Getting Started
Product Overview. Fuzzy Logic Toolbox Description. Installation. Using This Guide. What Is Fuzzy Logic?. Description of Fuzzy Logic. Why Use Fuzzy Logic?. When Not to Use Fuzzy Logic. What Can Fuzzy Logic Toolbox Software Do?. An Introductory Example: Fuzzy Versus Nonfuzzy Logic. The Basic Tipping Problem. The Nonfuzzy Approach. The Fuzzy Logic Approach. Problem Solution. 1-2 1-2 1-2 1-3 1-4 1-4 1-7 1-8 1-9

1-11 1-11 1-11 1-15 1-16

Tutorial
Overview. Foundations of Fuzzy Logic. Fuzzy Sets. Membership Functions. Logical Operations. If-Then Rules. Fuzzy Inference Systems. 2-2 2-4 2-4 2-8 2-13 2-16 2-20
What Are Fuzzy Inference Systems?. Overview of Fuzzy Inference Process. The Fuzzy Inference Diagram. Customization. Building Systems with Fuzzy Logic Toolbox Software. Fuzzy Logic Toolbox Graphical User Interface Tools. The Basic Tipping Problem. The FIS Editor. The Membership Function Editor. The Rule Editor. The Rule Viewer. The Surface Viewer. Importing and Exporting from the GUI Tools. Building Fuzzy Inference Systems Using Custom Functions. How to Build Fuzzy Inference Systems Using Custom Functions in the GUI. Specifying Custom Membership Functions. Specifying Custom Inference Functions. Working from the Command Line. The Tipping Problem from the Command Line. System Display Functions. Building a System from Scratch. FIS Evaluation. The FIS Structure. Working in Simulink Environment. An Example: Water Level Control. Building Your Own Fuzzy Simulink Models.

1.0 weekend-ness 1.0 weekend-ness 0.0 Thursday Friday Saturday Sunday Monday Thursday Friday Saturday Sunday Monday
Days of the weekend two-valued membership
Days of the weekend multivalued membership
Technically, the representation on the right is from the domain of multivalued logic (or multivalent logic). If you ask the question Is X a member of set A? the answer might be yes, no, or any one of a thousand intermediate values in between. Thus, X might have partial membership in A. Multivalued logic stands in direct contrast to the more familiar concept of two-valued (or bivalent yes-no) logic. To return to the example, now consider a continuous scale time plot of weekend-ness shown in the following plots.

1.0 weekend-ness

1.0 weekend-ness 0.0 Thursday Friday Saturday Sunday Monday Thursday Friday Saturday Sunday Monday
By making the plot continuous, you are defining the degree to which any given instant belongs in the weekend rather than an entire day. In the plot on the left, notice that at midnight on Friday, just as the second hand sweeps past 12, the weekend-ness truth value jumps discontinuously from 0 to 1. This is one way to define the weekend, and while it may be useful to an accountant, it may not really connect with your own real-world experience of weekend-ness. The plot on the right shows a smoothly varying curve that accounts for the fact that all of Friday, and, to a small degree, parts of Thursday, partake of the quality of weekend-ness and thus deserve partial membership in the fuzzy set of weekend moments. The curve that defines the weekend-ness of any instant in time is a function that maps the input space (time of the week) to the output space (weekend-ness). Specifically it is known as a membership function. See Membership Functions on page 3-3 for a more detailed discussion. As another example of fuzzy sets, consider the question of seasons. What season is it right now? In the northern hemisphere, summer officially begins at the exact moment in the earths orbit when the North Pole is pointed most directly toward the sun. It occurs exactly once a year, in late June. Using the astronomical definitions for the season, you get sharp boundaries as shown on the left in the figure that follows. But what you experience as the seasons vary more or less continuously as shown on the right in the following figure (in temperate northern hemisphere climates).

sprin g

summer

winter

degree of membership 0.0 March June September Time of the year December March

Membership Functions

A membership function (MF) is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1. The input space is sometimes referred to as the universe of discourse, a fancy name for a simple concept. One of the most commonly used examples of a fuzzy set is the set of tall people. In this case, the universe of discourse is all potential heights, say from 3 feet to 9 feet, and the word tall would correspond to a curve that defines the degree to which any person is tall. If the set of tall people is given the well-defined (crisp) boundary of a classical set, you might say all people taller than 6 feet are officially considered tall. However, such a distinction is clearly absurd. It may make sense to consider the set of all real numbers greater than 6 because numbers belong on an abstract plane, but when we want to talk about real people, it is unreasonable to call one person short and another one tall when they differ in height by the width of a hair.

min(A,B)

max(A,B)
Moreover, because there is a function behind the truth table rather than just the truth table itself, you can now consider values other than 1 and 0. The next figure uses a graph to show the same information. In this figure, the truth table is converted to a plot of two fuzzy sets applied together to create one fuzzy set. The upper part of the figure displays plots corresponding to the preceding two-valued truth tables, while the lower part of the figure displays how the operations work over a continuously varying range of truth values A and B according to the fuzzy operations you have defined.

A B B A or B

Two-valued logic

A and B

Multivalued logic

A and B A or B not A

Given these three functions, you can resolve any construction using fuzzy sets and the fuzzy logical operation AND, OR, and NOT.
Additional Fuzzy Operators
In this case, you defined only one particular correspondence between two-valued and multivalued logical operations for AND, OR, and NOT. This correspondence is by no means unique. In more general terms, you are defining what are known as the fuzzy intersection or conjunction (AND), fuzzy union or disjunction (OR), and fuzzy complement (NOT). The classical operators for these functions are: AND = min, OR = max, and NOT = additive complement. Typically, most fuzzy logic applications make use of these operations and leave it at that. In general, however, these functions are arbitrary to a surprising degree. Fuzzy Logic Toolbox software uses the classical operator for the fuzzy complement as shown in the previous figure, but also enables you to customize the AND and OR operators. The intersection of two fuzzy sets A and B is specified in general by a binary mapping T, which aggregates two membership functions as follows: AB(x) = T(A(x), B(x)) For example, the binary operator T may represent the multiplication of
A ( x ) and B ( x ). These fuzzy intersection operators, which are usually referred to as T-norm (Triangular norm) operators, meet the following basic requirements:
A T-norm operator is a binary mapping T(.,.) satisfying boundary: T(0, 0) = 0, T(a, 1) = T(1, a) = a monotonicity: T(a, b) <= T(c, d) if a <= c and b <= d commutativity: T(a, b) = T(b, a) associativity: T(a, T(b, c)) = T(T(a, b), c) The first requirement imposes the correct generalization to crisp sets. The second requirement implies that a decrease in the membership values in A or B cannot produce an increase in the membership value in A intersection B. The third requirement indicates that the operator is indifferent to the order of

In this topic, you use the Fuzzy Logic Toolbox graphical user interface (GUI) tools to build a Fuzzy Inference System (FIS) for the tipping example described in The Basic Tipping Problem on page 2-33. Use the following GUI tools to build, edit, and view fuzzy inference systems: Fuzzy Inference System (FIS) Editor to handle the high-level issues for the systemHow many input and output variables? What are their names? Fuzzy Logic Toolbox software does not limit the number of inputs. However, the number of inputs may be limited by the available memory of your machine. If the number of inputs is too large, or the number of membership functions is too big, then it may also be difficult to analyze the FIS using the other GUI tools. Membership Function Editor to define the shapes of all the membership functions associated with each variable Rule Editor to edit the list of rules that defines the behavior of the system. Rule Viewer to view the fuzzy inference diagram. Use this viewer as a diagnostic to see, for example, which rules are active, or how individual membership function shapes influence the results
Surface Viewer to view the dependency of one of the outputs on any one or two of the inputsthat is, it generates and plots an output surface map for the system. These GUIs are dynamically linked, in that changes you make to the FIS using one of them, affect what you see on any of the other open GUIs. For example, if you change the names of the membership functions in the Membership Function Editor, the changes are reflected in the rules shown in the Rule Editor. You can use the GUIs to read and write variables both to the MATLAB workspace and to a file (the read-only viewers can still exchange plots with the workspace and save them to a file). You can have any or all of them open for any given system or have multiple editors open for any number of FIS systems.

FIS Editor

Rule Editor
Membership Function Editor

Read-only tools

Rule Viewer

Surface Viewer

The following figure shows how the main components of a FIS and the three editors fit together. The two viewers examine the behavior of the entire system.
The General Case. Input Output A Specific Example. service tip The GUI Editors. The FIS Editor

The Rule Editor

service =

{poor, good, excellent}

{cheap, average, generous}
The Membership Function Editor
In addition to these five primary GUIs, the toolbox includes the graphical ANFIS Editor GUI, which you use to build and analyze Sugeno-type adaptive neuro-fuzzy inference systems. The Fuzzy Logic Toolbox GUIs do not support building FIS using data. If you want to use data to build a FIS, use one of the following techniques: genfis1, genfis2, or genfis3 commands to generate a Sugeno-type FIS. Then, select File > Import in the FIS Editor to import the FIS and perform fuzzy inference, as described in The FIS Editor on page 2-34. Neuro-adaptive learning techniques to model the FIS, as described in anfis and the ANFIS Editor GUI on page 2-107. If you wan to use MATLAB workspace variables, use the command-line interface instead of the FIS Editor. For an example, see Building a System from Scratch on page 2-78.

Tip To change a rule, first click on the rule to be changed. Next make the desired changes to that rule, and then click Change rule. For example, to change the first rule to 1. If (service not poor) or (food not rancid) then (tip is not cheap) (1) Select the not check box under each variable, and then click Change rule. The Format pop-up menu from the Options menu indicates that you are looking at the verbose form of the rules. Try changing it to symbolic. You will see 1. (service==poor) | (food==rancid) => (tip=cheap) (1) 2. (service==good) => (tip=average) (1) 3. (service==excellent) | (food==delicious) => (tip=generous) (1) There is not much difference in the display really, but it is slightly more language neutral, because it does not depend on terms like if and then. If you change the format to indexed, you see an extremely compressed version of the rules. 1 1, 1 (1) : 0, 2 (1) : 2, 3 (1) : 2 This is the version of the rules that the machine deals with. The first column in this structure corresponds to the input variables. The second column corresponds to the output variable. The third column displays the weight applied to each rule. The fourth column is shorthand that indicates whether this is an OR (2) rule or an AND (1) rule.
The numbers in the first two columns refer to the index number of the membership function. A literal interpretation of rule 1 is If input 1 is MF1 (the first membership function associated with input 1) or if input 2 is MF1, then output 1 should be MF1 (the first membership function associated with output 1) with the weight 1. The symbolic format does not consider the terms, if, then, and so on. The indexed format doesnt even bother with the names of your variables. Obviously the functionality of your system doesnt depend on how well you have named your variables and membership functions. The whole point of naming variables descriptively is, as always, making the system easier for you to interpret. Thus, unless you have some special purpose in mind, it is probably be easier for you to continue with the verbose format. At this point, the fuzzy inference system has been completely defined, in that the variables, membership functions, and the rules necessary to calculate tips are in place. Now, look at the fuzzy inference diagram presented at the end of the previous section and verify that everything is behaving the way you think it should. You can use the Rule Viewer, the next of the GUI tools well look at. From the View menu, select Rules.

The Rule Viewer

The Rule Viewer displays a roadmap of the whole fuzzy inference process. It is based on the fuzzy inference diagram described in the previous section. You see a single figure window with 10 plots nested in it. The three plots across the top of the figure represent the antecedent and consequent of the first rule. Each rule is a row of plots, and each column is a variable. The rule numbers are displayed on the left of each row. You can click on a rule number to view the rule in the status line. The first two columns of plots (the six yellow plots) show the membership functions referenced by the antecedent, or the if-part of each rule. The third column of plots (the three blue plots) shows the membership functions referenced by the consequent, or the then-part of each rule.

To build your own Simulink systems that use fuzzy logic, simply copy the Fuzzy Logic Controller block out of sltank (or any of the other Simulink demo systems available with the toolbox) and place it in your own block diagram. You can also find the Fuzzy Logic Controller blocks in the Fuzzy Logic Toolbox library. You can open the library by selecting Fuzzy Logic Toolbox in the Simulink Library Browser window, or by typing

fuzblock

at the MATLAB prompt. The following library appears.
The Fuzzy Logic Toolbox library contains the Fuzzy Logic Controller and Fuzzy Logic Controller with Rule Viewer blocks. It also includes a Membership Functions sublibrary that contains Simulink blocks for the built-in membership functions. To add a block from the library, drag the block into the Simulink model window. You can get help on a specific block by clicking Help.
About the Fuzzy Logic Controller Block
For most fuzzy inference systems, the Fuzzy Logic Controller block automatically generates a hierarchical block diagram representation of your FIS. This automatic model generation ability is called the Fuzzy Wizard. The block diagram representation only uses built-in Simulink blocks and, therefore, allows for efficient code generation. For more information about the Fuzzy Logic Controller block, see the fuzblock reference page. The Fuzzy Wizard cannot handle FIS with custom membership functions or with AND, OR, IMP, and AGG functions outside of the following list: orMethod:
andMethod: min,prod impMethod: min,prod aggMethod: max In these cases, the Fuzzy Logic Controller block uses the S-function sffis to simulate the FIS. For more information, see the sffis reference page.
About the Fuzzy Logic Controller with Ruleviewer Block
The Fuzzy Logic Controller with Rule Viewer block is an extension of the Fuzzy Logic Controller block. It allows you to visualize how rules are fired during simulation. Right-click on the Fuzzy Controller With Rule Viewer block, and select Look Under Mask, and the following window appears.
Initializing Fuzzy Logic Controller Blocks
You can initialize a Fuzzy Logic Controller or Fuzzy Logic Controller with Ruleviewer block using a fuzzy inference system saved as a.fis file or a structure. To learn how to save your fuzzy inference system, see Importing and Exporting from the GUI Tools on page 2-57. To initialize a Fuzzy Logic Controller block, use the following steps:
1 Double-click the block to open the Function Block Parameters: Fuzzy Logic

Controller dialog box.

2 In FIS file or structure, enter the name of the structure variable or the

name of the.fis file.

If you are using the Fuzzy Logic Controller with Ruleviewer block, enter the name of the structure variable or the name of the.fis file in FIS matrix. Note When entering the name of the.fis file in the blocks, you must enclose it in single quotes.

where F1,2 (.) are the membership functions for Inputs 1 and 2.
The final output of the system is the weighted average of all rule outputs, computed as

wi zi

Final Output =
where N is the number of rules.
A Sugeno rule operates as shown in the following diagram.
2. Apply fuzzy operation (OR = max)
3. Apply implication method (prod).

z 1 (cheap) z1

z 2 (average)

tip = average

z 3 (generous) z3

service is excellent or

tip = 16.3%
The preceding figure shows the fuzzy tipping model developed in previous sections of this manual adapted for use as a Sugeno system. Fortunately, it is frequently the case that singleton output functions are completely sufficient for the needs of a given problem. As an example, the system tippersg.fis is
the Sugeno-type representation of the now-familiar tipping model. If you load the system and plot its output surface, you will see that it is almost the same as the Mamdani system you have previously seen.
a = readfis('tippersg'); gensurf(a)

2 food 2 service 8 10

The easiest way to visualize first-order Sugeno systems is to think of each rule as defining the location of a moving singleton. That is, the singleton output spikes can move around in a linear fashion in the output space, depending on what the input is. This also tends to make the system notation very compact and efficient. Higher-order Sugeno fuzzy models are possible, but they introduce significant complexity with little obvious merit. Sugeno fuzzy models whose output membership functions are greater than first order are not supported by Fuzzy Logic Toolbox software. Because of the linear dependence of each rule on the input variables, the Sugeno method is ideal for acting as an interpolating supervisor of multiple linear controllers that are to be applied, respectively, to different operating conditions of a dynamic nonlinear system. For example, the performance
of an aircraft may change dramatically with altitude and Mach number. Linear controllers, though easy to compute and well suited to any given flight condition, must be updated regularly and smoothly to keep up with the changing state of the flight vehicle. A Sugeno fuzzy inference system is extremely well suited to the task of smoothly interpolating the linear gains that would be applied across the input space; it is a natural and efficient gain scheduler. Similarly, a Sugeno system is suited for modeling nonlinear systems by interpolating between multiple linear models.

An Example: Two Lines

To see a specific example of a system with linear output membership functions, consider the one input one output system stored in sugeno1.fis.
fismat = readfis('sugeno1'); getfis(fismat,'output',1)

This syntax returns:

Name = output NumMFs = 2 MFLabels = line1 line2 Range = [0 1]
The output variable has two membership functions.
getfis(fismat,'output',1,'mf',1)
Name = line1 Type = linear Params = -1 -1 getfis(fismat,'output',1,'mf',2)
Name = line2 Type = linear Params = 1 -1
Further, these membership functions are linear functions of the input variable. The membership function line1 is defined by the equation

output = (1) input + (1)

and the membership function line2 is defined by the equation
The input membership functions and rules define which of these output functions are expressed and when:
showrule(fismat) ans = 1. If (input is low) then (output is line1) (1) 2. If (input is high) then (output is line2) (1)
The function plotmf shows us that the membership function low generally refers to input values less than zero, while high refers to values greater than zero. The function gensurf shows how the overall fuzzy system output switches smoothly from the line called line1 to the line called line2.
subplot(2,1,1), plotmf(fismat,'input',1) subplot(2,1,2),gensurf(fismat)

1 Degree of belief

0.8 0.6 0.4 0.input 5

output input 5

As this example shows, Sugeno-type system gives you the freedom to incorporate linear systems into your fuzzy systems. By extension, you could build a fuzzy system that switches between several optimal linear controllers as a highly nonlinear system moves around in its operating space.
Comparison of Sugeno and Mamdani Methods
Because it is a more compact and computationally efficient representation than a Mamdani system, the Sugeno system lends itself to the use of adaptive techniques for constructing fuzzy models. These adaptive techniques can be used to customize the membership functions so that the fuzzy system best models the data.
Note You can use the MATLAB command-line function mam2sug to convert a Mamdani system into a Sugeno system (not necessarily with a single output) with constant output membership functions. It uses the centroid associated with all of the output membership functions of the Mamdani system. See Chapter 4, Functions Alphabetical List for details. The following are some final considerations about the two different methods.

Initializing and Generating Your FIS
You can either initialize the FIS parameters to your own preference, or if you do not have any preference for how you want the initial membership functions to be parameterized, you can let anfis initialize the parameters for you, as described in the following sections: Automatic FIS Structure Generation on page 2-119
Specifying Your Own Membership Functions for ANFIS on page 2-120
Automatic FIS Structure Generation
To initialize your FIS using anfis:
1 Choose Grid partition, the default partitioning method. The two partition
methods, grid partitioning and subtractive clustering, are described later in Fuzzy C-Means Clustering on page 2-149, and in Subtractive Clustering on page 2-155.
2 Click on the Generate FIS button. Clicking this button displays a menu
from which you can choose the number of membership functions, MFs, and the type of input and output membership functions. There are only two choices for the output membership function: constant and linear. This limitation of output membership function choices is because anfis only operates on Sugeno-type systems.
3 Fill in the entries as shown in the following figure, and click OK.
You can also implement this FIS generation from the command line using the command genfis1 (for grid partitioning) or genfis2 (for subtractive clustering).
Specifying Your Own Membership Functions for ANFIS
You can choose your own preferred membership functions with specific parameters to be used by anfis as an initial FIS for training. To define your own FIS structure and parameters:
1 Open the Membership functions menu item from the Edit menu. 2 Add your desired membership functions (the custom membership option
will be disabled for anfis). The output membership functions must either be all constant or all linear. For carrying out this and the following step, see The FIS Editor on page 2-34 and The Membership Function Editor on page 2-39.
3 Select the Rules menu item in the Edit menu, and use the Rule Editor to
generate the rules (see The Rule Editor on page 2-49).
4 Select the FIS Properties menu item from the Edit menu. Name your
FIS, and save it to either the workspace or to file.
5 Click the Close button to return to the ANFIS Editor GUI to train the FIS. 6 To load an existing FIS for ANFIS initialization, in the Generate FIS
portion of the GUI, click Load from worksp. or Load from file. You load your FIS from a file if you have saved a FIS previously that you would like to use. Otherwise you load your FIS from the workspace.

You cannot control the step-size options with the ANFIS Editor GUI. Using the command line anfis, the step-size array ss records the step-size during the training. Plotting ss gives the step-size profile, which serves as a reference for adjusting the initial step-size and the corresponding decrease and increase rates. The step-size (ss) for the command-line function anfis is updated according to the following guidelines: If the error undergoes four consecutive reductions, increase the step-size by multiplying it by a constant (ssinc) greater than one. If the error undergoes two consecutive combinations of one increase and one reduction, decrease the step-size by multiplying it by a constant (ssdec) less than one. The default value for the initial step-size is 0.01; the default values for ssinc and ssdec are 1.1 and 0.9, respectively. All the default values can be changed via the training option for the command line anfis.

Checking Data

The checking data, chkData, is used for testing the generalization capability of the fuzzy inference system at each epoch. The checking data has the same format as that of the training data, and its elements are generally distinct from those of the training data. The checking data is important for learning tasks for which the input number is large, and/or the data itself is noisy. A fuzzy inference system needs to track a given input/output data set well. Because the model structure used for anfis is fixed, there is a tendency for the model to overfit the data on which is it trained, especially for a large number of training epochs. If overfitting does occur, the fuzzy inference system may not respond well to other independent data sets, especially if they are corrupted by noise. A validation or checking data set can be useful for these situations. This data set is used to cross-validate the fuzzy inference model. This cross-validation requires applying the checking data to the model and then seeing how well the model responds to this data. When the checking data option is used with anfis, either via the command line, or using the ANFIS Editor GUI, the checking data is applied to the model at each training epoch. When the command line anfis is invoked, the model parameters that correspond to the minimum checking error are returned via the output argument fismat2. The FIS membership function parameters computed using the ANFIS Editor GUI when both training and checking data are loaded are associated with the training epoch that has a minimum checking error. The use of the minimum checking data error epoch to set the membership function parameters assumes The checking data is similar enough to the training data that the checking data error decreases as the training begins. The checking data increases at some point in the training after the data overfitting occurs. Depending on the behavior of the checking data error, the resulting FIS may or may not be the one you need to use. Refer to ANFIS Editor GUI Example 2: Checking Data Does Not Validate Model on page 2-125.

fismat=genfis2(datin,datout,0.5);
The genfis2 function is a fast, one-pass method that does not perform any iterative optimization. A FIS structure is returned; the model type for the FIS structure is a first order Sugeno model with three rules. Use the following commands to verify the model. Here, trnRMSE is the root mean square error of the system generated by the training data.
fuzout=evalfis(datin,fismat); trnRMSE=norm(fuzout-datout)/sqrt(length(fuzout))
These commands return the following result:

trnRMSE = 0.5276

Next, apply the test data to the FIS to validate the model. In this example, the checking data is used for both checking and testing the FIS parameters. Here, chkRMSE is the root mean square error of the system generated by the checking data.
chkfuzout=evalfis(chkdatin,fismat); chkRMSE=norm(chkfuzout-chkdatout)/sqrt(length(chkfuzout))

chkRMSE = 0.6179

Use the following commands to plot the output of the model chkfuzout against the checking data chkdatout.
figure plot(chkdatout) hold on plot(chkfuzout,'o') hold off
The model output and checking data are shown as circles and solid blue line, respectively. The plot shows the model does not perform well on the checking data.
At this point, you can use the optimization capability of anfis to improve the model. First, try using a relatively short anfis training (20 epochs) without implementing the checking data option, and then test the resulting FIS model against the testing data. To perform the optimization, type the following command:
fismat2=anfis([datin datout],fismat,[0.1]);
Here, 20 is the number of epochs, 0 is the training error goal, and 0.1 is the initial step size. This command returns the following result:
ANFIS info: Number of nodes: 44 Number of linear parameters: 18 Number of nonlinear parameters: 30 Total number of parameters: 48 Number of training data pairs: 75 Number of checking data pairs: 0 Number of fuzzy rules: 3 Start training ANFIS. 1. 20 0.420275 0.527607
Designated epoch number reached --> ANFIS training completed at epoch 20.

1 0.75 0.5 0.pimf, P = [5 10] 8 10
dsigmf | evalmf | gauss2mf | gaussmf | gbellmf | mf2mf | psigmf | sigmf | smf | trapmf | trimf | zmf

plotfis

Plot Fuzzy Inference System

plotfis(fismat)

This function displays a high level diagram of a FIS, fismat. Inputs and their membership functions appear to the left of the FIS structural characteristics, while outputs and their membership functions appear on the right.
a = readfis('tipper'); plotfis(a)

evalmf | plotmf

plotmf
Plot all membership functions for given variable
plotmf(fismat,varType,varIndex)
This function plots all of the membership functions in the FIS called fismat associated with a given variable whose type and index are respectively given by varType (must be 'input' or 'output'), and varIndex. This function can also be used with the MATLAB function, subplot.
a = readfis('tipper'); plotmf(a,'input',1)

evalmf | plotfis

probor

Probabilistic OR

y = probor(x) y = probor(x) returns the probabilistic OR (also known as the algebraic sum) of the columns of x. if x has two rows such that x = [a; b], then y = a + b - ab. If x has only one row, then y = x. x = (0:0.1:10); figure('Name','Probabilistic OR','NumberTitle','off'); y1 = gaussmf(x, [0.5 4]); y2 = gaussmf(x, [2 7]); yy = probor([y1; y2]); plot(x,[y1; y2; yy])
Built-in membership function composed of product of two sigmoidally shaped membership functions
y = psigmf(x,[a1 c1 a2 c2])
The sigmoid curve plotted for the vector x depends on two parameters a and c as given by

f ( x; a, c) =

psigmf is simply the product of two such curves plotted for the values of the vector x
f1(x; a1, c1) f2(x; a2, c2) The parameters are listed in the order [a1 c1 a2 c2].
x=0:0.1:10; y=psigmf(x,[-5 8]); plot(x,y) xlabel('psigmf, P=[-5 8]')
dsigmf | gaussmf | gauss2mf | gbellmf | evalmf | mf2mf | pimf | sigmf | smf | trapmf | trimf | zmf

readfis

Load Fuzzy Inference System from file
fismat = readfis('filename')
Read a fuzzy inference system from a.fis file (named filename) and import the resulting file into the workspace.

a = newfis('tipper'); a = addvar(a,'input','service',[0 10]); a = addmf(a,'input',1,'poor','gaussmf',[1.5 0]); a = addmf(a,'input',1,'good','gaussmf',[1.5 5]); a = addmf(a,'input',1,'excellent','gaussmf',[1.5 10]); writefis(a,'my_file') readfis
Z-shaped built-in membership function

y = zmf(x,[a b])

This spline-based function of x is so named because of its Z-shape. The parameters a and b locate the extremes of the sloped portion of the curve as given by.
1, xa 2 x a , a x a + b 2 b a f ( x; a, b) = 2 a+b x b x b 2 b - a , 2 0, xb
x=0:0.1:10; y=zmf(x,[3 7]); plot(x,y) xlabel('zmf, P=[3 7]')
1 0.75 0.5 0.zmf, P = [3 7] 8 10
dsigmf | gaussmf | gauss2mf | gbellmf | evalmf | mf2mf | pimf | psigmf | sigmf | smf | trapmf | trimf
Controllers (p. 5-2) Logical Operators (p. 5-3) Membership Functions (p. 5-4) Controller blocks that implement fuzzy inference systems Probabilistic OR blocks for use with membership function blocks Blocks that implement various membership functions

Controllers

Fuzzy Logic Controller Fuzzy Logic Controller with Ruleviewer Fuzzy inference system in Simulink software Fuzzy inference system with Ruleviewer in Simulink software

Logical Operators

Probabilistic OR Probabilistic Rule Agg Probabilistic OR function in Simulink software Probabilistic OR function, rule aggregation method
Diff. Sigmoidal MF Difference of two sigmoids membership function in Simulink software Gaussian membership function in Simulink software Combination of two Gaussian membership functions in Simulink software Generalized bell membership function in Simulink software Pi-shaped membership function in Simulink software Product of two sigmoid membership functions in Simulink software S-shaped membership function in Simulink software Sigmoidal membership function in Simulink software Trapezoidal membership function in Simulink software Triangular membership function in Simulink software Z-shaped membership function in Simulink software

Gaussian MF Gaussian2 MF

Generalized Bell MF Pi-shaped MF Prod. Sigmoidal MF S-shaped MF Sigmoidal MF Trapezoidal MF Triangular MF Z-shaped MF

Diff. Sigmoidal MF

Purpose Description
Difference of two sigmoids membership function in Simulink software The Diff. Sigmoidal MF block implements a membership function in Simulink based on the difference between two sigmoids. The two sigmoid curves are given by

fk ( x) =

+ exp( ak ( x ck ))
where k=1,2. The parameters a1and a2 control the slopes of the left and right curves. The parameters c1 and c2 control the points of inflection for the left and right curves. The parameters a1 and a2 should be positive.

Fuzzy Logic Controller

Fuzzy inference system in Simulink software The Fuzzy Logic Controller block implements a fuzzy inference system (FIS) in Simulink. See Working in Simulink Environment on page 2-86 for a discussion of how to use this block.

doc1

CSE 616 Pattern recognition

Dr. Djamel Bouchaffra

Plotting in Matlab and Fuzzy Logic Toolbox -------An Introduction

PLOT (2-D plotting)

Linear plot. PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector, length(Y) disconnected points are plotted. PLOT(Y) plots the columns of Y versus their index. If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)). In all other uses of PLOT, the imaginary part is ignored.

MATLAB Session

Line plot
x = 0 : 0.05 : 5; y = sin(x.^ 2); plot(x, y);

Other 2-D plotting

bar stairs errorbar polar stem

MESH (3-D plotting)

% Mesh Plot of Peaks z=peaks(25); mesh(z);

Other 3-D plotting

surf surfl contour quiver slice

Example

x 2 20

y young = e

Membership Function of young Filename: mfyoung.m function y = mfyoung(x) % member function: young y = exp(-power(x/20,2));

yold = e

x 30
Membership Function of old Filename: mfold.m function y = mfold(x) % member function: old y = exp(-power((x-100)/30,2));
yveryyoung = y young 2 yveryold = yold
ynot _ veryyoung _ and _ not _ veryold = min ( yveryyoung , yveryold )
yveryyoung _ or _ veryold = max ( yveryyoung , yveryold )
x = 0:1:100; % people age between 0 and 100. y=min((1-power(mfyoung(x), 2)),(1-power(mfold(x), 2))); % not very young and not very old. plot(x,y) y=max(power(mfyoung(x), 2), power(mfold(x), 2)); % very young or very old figure, plot(x,y) % open a new figure window and plot
Fuzzy Logic Toolbox (GUI)

Start the toolbox:

FIS Editor

MF Editor

Rules Editor

Command Line functions

plotfis plotmf gensurf
Built-in membership functions
Building a FIS from scratch
The Basic Tipping Problem. Given a number between 0 and 10 that represents the quality of service at a restaurant (where 10 is excellent), and another number between 0 and 10 that represents the quality of the food at that restaurant (again, 10 is excellent), what should the tip be?
Building a FIS from scratch (cont.)
1. If the service is poor or the food is rancid, then tip is cheap. 2. If the service is good, then tip is average. 3. If the service is excellent or the food is delicious, then tip is generous. We'll assume that an average tip is 15%, a generous tip is 25%, and a cheap tip is 5%. It's also useful to have a vague idea of what the tipping function should look like.

Decision Surface

http://www.mathworks.com/access/helpdesk/h elp/pdf_doc/fuzzy/fuzzy_tb.pdf http://www.mathworks.com/access/helpdesk/h elp/toolbox/fuzzy/fuzzy.shtml

 

Tags

CLD60 C21rjan SPA-2002 Krups F860 BGD-V18 Podxt PRO Korg X3 E-800 MZ-R50 KDL-46Z4500 Tubepre T4020D DD400 Forms CQ-DFX501N WD-1253FHB DEH-P4650MP LG 500 Photostudio 10 Royal LE37A659a1F Digital Easyshare C503 RC 8530 Xserve G5 RX-DT505 Lite 350 SX-P50 PRO 26 Photosmart 7850 LN32A450c1D TXP42GT20B Zoom 115 VR110 DC-8814M Yamaha C40 Neromix 240v DX-800 KM-F1060 Sharan KX-TG6444 ZH6022W I Ams200 STA-800 XR-10SL MDS-LSA1 Presario 2800 LAN Disk RX-V100D KV-32V15 Capture NX Audio 350 SGH-Z630 MPA160 4880C EA150crema OK-M33GX Photosmart 100 34401A Trio 619 MY419X SGH-F480W TX-32LED7FM VP-DX1000 563A-CB563c-aa- KLV-W40a10E 28PT7104 Samsung 193T ID6294W STR-DA5600ES ICD-UX200 86162 HXR4LD EW1279F L193SA HT-Q100 DSC-S600 EW659F Electro-voice Q66 Sbchd1500U K-1000 Rapide HK 3380 G31M-VS APA4200G Uk Alchemist Radio II Vampyr 5090 Adapter XEC-1000 PET1031 Review HQ9080 Server Optoma DV10 RH7800 DG 6145 MV960 WVC54G

 

manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding

 

Sitemap

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