function fuz_con

% FUZ_CON Show the help for the functions in this toolbox.

% This file is automatically generated.  Matthew Simoneau, 09-04-98
% Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
% $Revision: 1.13 $ $Date: 1998/10/16 23:19:19 $

helpwin('fuz_con/Contents');

function Contents
%MATLAB Tour Partial Function Help:  fuz_con
%
%Double click on any function for more information
%
%  Fuzzy Logic Toolbox.
%  Version 2.0.1 (R11)  15-Nov-1997  
% 
%  GUI editors
%    anfisedit  - ANFIS training and testing UI tool.
%    findcluster- Clustering UI tool.
%    fuzzy      - Basic FIS editor.
%    mfedit     - Membership function editor.
%    ruleedit   - Rule editor and parser.
%    ruleview   - Rule viewer and fuzzy inference diagram.
%    surfview   - Output surface viewer.
% 
%  Membership functions.
%    dsigmf     - Difference of two sigmoid membership functions.
%    gauss2mf   - Two-sided Gaussian curve membership function.
%    gaussmf    - Gaussian curve membership function.
%    gbellmf    - Generalized bell curve membership function.
%    pimf       - Pi-shaped curve membership function.
%    psigmf     - Product of two sigmoid membership functions.
%    smf        - S-shaped curve membership function.
%    sigmf      - Sigmoid curve membership function.
%    trapmf     - Trapezoidal membership function.
%    trimf      - Triangular membership function.
%    zmf        - Z-shaped curve membership function.
% 
%  Command line FIS functions
%    addmf      - Add membership function to FIS
%    addrule    - Add rule to FIS.
%    addvar     - Add variable to FIS.
%    defuzz     - Defuzzify membership function.
%    evalfis    - Perform fuzzy inference calculation.
%    evalmf     - Generic membership function evaluation.
%    gensurf    - Generate FIS output surface.
%    getfis     - Get fuzzy system properties.
%    mf2mf      - Translate parameters between functions.
%    newfis     - Create new FIS.
%    parsrule   - Parse fuzzy rules.
%    plotfis    - Display FIS input-output diagram.
%    plotmf     - Display all membership functions for one variable.
%    readfis    - Load FIS from disk.
%    rmmf       - Remove membership function from FIS.
%    rmvar      - Remove variable from FIS.
%    setfis     - Set fuzzy system properties.
%    showfis    - Display annotated FIS.
%    showrule   - Display FIS rules.
%    writefis   - Save FIS to disk.
% 
%  Advanced techniques
%    anfis      - Training routine for Sugeno-type FIS (MEX only).
%    fcm        - Find clusters with fuzzy c-means clustering.
%    genfis1    - Generate FIS matrix using generic method.
%    genfis2    - Generate FIS matrix using subtractive clustering.
%    subclust   - Estimate cluster centers with subtractive clustering.
% 
%  Miscellaneous functions
%    convertfis - Convert v1.0 fuzzy matrix to v2.0 fuzzy structure.
%    discfis    - Discretize a fuzzy inference system.
%    evalmmf    - For multiple membership functions evaluation.
%    fstrvcat   - Concatenate matrices of varying size.
%    fuzarith   - Fuzzy arithmatic function.
%    findrow    - Find the rows of a matrix that match the input string.
%    genparam   - Generates initial premise parameters for ANFIS learning.
%    probor     - Probabilistic OR.
%    sugmax     - Maximum output range for a Sugeno system.
% 
%  GUI helper files
%    cmfdlg     - Add customized membership function dialog.
%    cmthdlg    - Add customized inference method dialog.
%    fisgui     - Generic GUI handling for the Fuzzy Logic Toolbox
%    gfmfdlg    - Generate fis using grid partition method dialog.
%    mfdlg      - Add membership function dialog.
%    mfdrag     - Drag membership functions using mouse.
%    popundo    - Pull the last change off the undo stack.
%    pushundo   - Push the current FIS data onto the undo stack.
%    savedlg    - Save before closing dialog.
%    statmsg    - Display messages in a status field.
%    updtfis    - Update Fuzzy Logic Toolbox GUI tools.
%    wsdlg      - Open from/save to workspace dialog.
%-------------------------------------------
%
%  Fuzzy Logic Toolbox Demos.
% 
%  General demos
%    defuzzdm   - Defuzzification methods.
%    fcmdemo    - Fuzzy c-means clustering demo (2-D).
%    fuzdemos   - List of all Fuzzy Logic Toolbox demos.
%    invkine    - Inverse kinematics system of a robot arm.
%    irisfcm    - Fuzzy c-means clustering demo (4-D).
%    juggler    - Juggling ball system.
%    mfdemo     - Membership functions.
%    mgtsdemo   - Mackey-Glass time series analysis.
%    noisedm    - Active noise cancellation.
%    trips      - Subtractive clustering demo with demographic data.
% 
%  SIMULINK demos
%    shower     - Shower temperature/flow control model (SIMULINK only).
%    slbb       - Ball and beam control (SIMULINK only)
%    slcp       - Inverted pendulum control (SIMULINK only)
%    slcp1      - Inv. pendulum with varying pole length (SIMULINK only)
%    slcpp1     - Double inv. pendulum with varying pole length (SIMULINK only)
%    sltank     - Water level control (SIMULINK only)
%    sltbu      - Truck backer-upper (SIMULINK only)
%

function anfisedit
%MATLAB Tour Partial Function Help:  fuz_con
%
% ANFISEDIT anfis GUI tool.
%    The ANFIS Editor is used to create, train, and test a Sugeno fuzzy system. 
% 
%    

function fuzzy
%MATLAB Tour Partial Function Help:  fuz_con
%
%  Fuzzy Logic Toolbox.
%  Version 2.0.1 (R11)  15-Nov-1997  
% 
%  GUI editors
%    anfisedit  - ANFIS training and testing UI tool.
%    findcluster- Clustering UI tool.
%    fuzzy      - Basic FIS editor.
%    mfedit     - Membership function editor.
%    ruleedit   - Rule editor and parser.
%    ruleview   - Rule viewer and fuzzy inference diagram.
%    surfview   - Output surface viewer.
% 
%  Membership functions.
%    dsigmf     - Difference of two sigmoid membership functions.
%    gauss2mf   - Two-sided Gaussian curve membership function.
%    gaussmf    - Gaussian curve membership function.
%    gbellmf    - Generalized bell curve membership function.
%    pimf       - Pi-shaped curve membership function.
%    psigmf     - Product of two sigmoid membership functions.
%    smf        - S-shaped curve membership function.
%    sigmf      - Sigmoid curve membership function.
%    trapmf     - Trapezoidal membership function.
%    trimf      - Triangular membership function.
%    zmf        - Z-shaped curve membership function.
% 
%  Command line FIS functions
%    addmf      - Add membership function to FIS
%    addrule    - Add rule to FIS.
%    addvar     - Add variable to FIS.
%    defuzz     - Defuzzify membership function.
%    evalfis    - Perform fuzzy inference calculation.
%    evalmf     - Generic membership function evaluation.
%    gensurf    - Generate FIS output surface.
%    getfis     - Get fuzzy system properties.
%    mf2mf      - Translate parameters between functions.
%    newfis     - Create new FIS.
%    parsrule   - Parse fuzzy rules.
%    plotfis    - Display FIS input-output diagram.
%    plotmf     - Display all membership functions for one variable.
%    readfis    - Load FIS from disk.
%    rmmf       - Remove membership function from FIS.
%    rmvar      - Remove variable from FIS.
%    setfis     - Set fuzzy system properties.
%    showfis    - Display annotated FIS.
%    showrule   - Display FIS rules.
%    writefis   - Save FIS to disk.
% 
%  Advanced techniques
%    anfis      - Training routine for Sugeno-type FIS (MEX only).
%    fcm        - Find clusters with fuzzy c-means clustering.
%    genfis1    - Generate FIS matrix using generic method.
%    genfis2    - Generate FIS matrix using subtractive clustering.
%    subclust   - Estimate cluster centers with subtractive clustering.
% 
%  Miscellaneous functions
%    convertfis - Convert v1.0 fuzzy matrix to v2.0 fuzzy structure.
%    discfis    - Discretize a fuzzy inference system.
%    evalmmf    - For multiple membership functions evaluation.
%    fstrvcat   - Concatenate matrices of varying size.
%    fuzarith   - Fuzzy arithmatic function.
%    findrow    - Find the rows of a matrix that match the input string.
%    genparam   - Generates initial premise parameters for ANFIS learning.
%    probor     - Probabilistic OR.
%    sugmax     - Maximum output range for a Sugeno system.
% 
%  GUI helper files
%    cmfdlg     - Add customized membership function dialog.
%    cmthdlg    - Add customized inference method dialog.
%    fisgui     - Generic GUI handling for the Fuzzy Logic Toolbox
%    gfmfdlg    - Generate fis using grid partition method dialog.
%    mfdlg      - Add membership function dialog.
%    mfdrag     - Drag membership functions using mouse.
%    popundo    - Pull the last change off the undo stack.
%    pushundo   - Push the current FIS data onto the undo stack.
%    savedlg    - Save before closing dialog.
%    statmsg    - Display messages in a status field.
%    updtfis    - Update Fuzzy Logic Toolbox GUI tools.
%    wsdlg      - Open from/save to workspace dialog.
%
%
%fuzzy is both a directory and a function.
%
% FUZZY  Basic FIS editor.
%    The FIS Editor displays high-level information about a 
%    Fuzzy Inference System. At the top is a diagram of the 
%    system with each input and output clearly labeled. By 
%    double-clicking on the input or output boxes, you can bring 
%    up the Membership Function Editor. Double-clicking on the 
%    fuzzy rule box in the center of the diagram will bring up 
%    the Rule Editor.                     
%                                                 
%    Just below the diagram is a text field that displays the 
%    name of the current FIS. In the lower left of the window are 
%    a series of popup menus that allow you to specify the various 
%    functions used in the fuzzy implication process. In the lower 
%    right are fields that provide information about the current 
%    variable. The current variable is determined by clicking once
%    on one of the input or output boxes.
% 
%    

function mfedit
%MATLAB Tour Partial Function Help:  fuz_con
%
% MFEDIT Membership function editor.
%    The Membership Function (MF) Editor is used to create, 
%    remove, and modify the MFs for a given fuzzy system. On 
%    the left side of the diagram is a "variable palette" 
%    region that you use to select the current variable by 
%    clicking once on one of the displayed boxes. Information   
%    about the current variable is displayed in the text region 
%    below the palette area.
% 
%    To the right is a plot of all the MFs for the current 
%    variable. You can select any of these by clicking once on 
%    the line or name of the MF. Once selected, you can modify 
%    the properties of the MF using the controls in the lower right.  
%    MFs are added and removed using the Edit menu.    
% 
%    

function ruleedit
%MATLAB Tour Partial Function Help:  fuz_con
%
% 
%   Purpose
%   Rule editor and parser.
%   Synopsis
%   ruleedit('a')
%   ruleedit(a)
%   Description
%   
%   The Rule Editor, when invoked using ruleedit('a'), is used to modify the
%   rules of a FIS structure stored in a file, a.fis. It can also be used to
%   inspect the rules being used by a fuzzy inference system. 
%   To use this editor to create rules, you must first have all of the input
%   and output variables you want to use defined with the FIS editor. You can
%   create the rules using the listbox and check
%   box choices for input and
%   output variables, connections, and weights. 
%   The syntax ruleedit(a) is used when you want to operate on a workspace
%   variable for a FIS structure called a. 
% 
%   Menu Items
%   On the Rule Editor, there is a menu bar that allows you to open related GUI 
%   tools, open and save systems, and so on. The File menu for the Rule Editor 
%   is the same as the one found on the FIS Editor. Refer to the Reference 
%   entry fuzzy for more information.
%   Use the Edit menu items:
%   Undo: to undo the most recent change.
%   Use the View menu items:
%   Edit FIS properties... to invoke the FIS Editor.
%   Edit membership functions... to invoke the Membership Function Editor.
%   View rules... to invoke the Rule Viewer.
%   View surface... to invoke the Surface Viewer.
%   Use the Options menu items:
%   Language to select the language: English, Deutsch, and Francais
%   Format: to select the format: 
%   verbose uses the words *if* and *then* and so on to create actual 
%   sentences.
%   symbolic substitutes some symbols for the words used in the verbose mode. 
%   For example, *if A and B then C* becomes *A & B => C.*
%   indexed mirrors how the rule is stored in the FIS matrix.
% 
%   

function ruleview
%MATLAB Tour Partial Function Help:  fuz_con
%
% RULEVIEW Rule viewer and fuzzy inference diagram.
%    RULEVIEW(fis) opens the Rule Viewer, or Inference Diagram
%    Viewer, for the fuzzy inference system, fis. 
%    RULEVIEW('FILENAME') depicts the fuzzy inference 
%    diagram for the fuzzy inference system stored in file
%    FILENAME.FIS.
% 
%    The Rule Viewer displays, in one screen, all parts of 
%    the fuzzy inference process from inputs to outputs. Each 
%    row of plots corresponds to one rule, and each column of 
%    plots corresponds to either an input variable (yellow, on 
%    the left) or an output variable (blue, on the right). You
%    can change the system input either by typing a specific 
%    value into the Input window or by moving the long yellow 
%    index lines that go down each input variable's column of 
%    plots.
%                                                                      
%    

function surfview
%MATLAB Tour Partial Function Help:  fuz_con
%
% SURFVIEW Output surface viewer.
%    The Surface Viewer invoked using surfview('a') is a GUI tool that lets you 
%    examine the output surface of a FIS, a.fis, for any one or two inputs. 
%    Since it does not alter the fuzzy system or its associated FIS matrix in 
%    any way, it is a read-only editor. Using the pop-up menus, you select the 
%    two input variables you want assigned to the two input axes (X and Y), as 
%    well the output variable you want assigned to the output (or Z) axis. Select 
%    the Evaluate button to perform the calculation and plot the output surface.
%    By clicking on the plot axes and dragging the mouse, you can actually 
%    manipulate the surface so that you can view it from different angles.
%    If there are more than two inputs to your system, you must supply, in the 
%    reference input section, the constant values associated with any unspecified 
%    inputs. 
%    
%    

function dsigmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% DSIGMF Membership function composed of the difference between two sigmoidal
%    membership functions.
%    Synopsis
%    y = dsigmf(x,[a1 c1 a2 c2])
%    Description
%    The sigmoidal membership function used here depends on the two parameters a
%    and c and is given by f(x;a,c) = 1/(1 + exp(-a(x-c))).
%    The membership function dsigmf depends on four parameters, a1, c1, a2, and
%    c2, and is the difference between two of these sigmoidal functions:
%    f1(x; a1, c1) - f2(x; a2, c2)
%    The parameters are listed in the order: [a1 c1 a2 c2].
%    Example
%    x=0:0.1:10;
%    y=dsigmf(x,[5 2 5 7]);
%    plot(x,y)
%    xlabel('dsigmf, P=[5 2 5 7]')
% 
%    

function gauss2mf
%MATLAB Tour Partial Function Help:  fuz_con
%
%    Two-sided Gaussian membership function.
% 
%    Synopsis
%    y = gauss2mf(x,params)
%    y = gauss2mf(x,[sig1 c1 sig2 c2])
% 
%    Description
%    The Gaussian function depends on two parameters sig and c as given by
%    The function gauss2mf is a combination of two of these. The first function,
%    specified by sig1 and c1, determines the shape of the leftmost curve. the
%    second function determines the shape of the rightmost curve. Whenever c1 <
%    c2, the gauss2mf function reaches a maximum value of 1. Otherwise, the
%    maximum value is less than one. The parameters are listed in the order:
%    [sig1, c1, sig2, c2].
% 
%    Examples
%    x = (0:0.1:10)';
%    	y1 = gauss2mf(x, [2 4 1 8]);
%    	y2 = gauss2mf(x, [2 5 1 7]);
%    	y3 = gauss2mf(x, [2 6 1 6]);
%    	y4 = gauss2mf(x, [2 7 1 5]);
%    	y5 = gauss2mf(x, [2 8 1 4]);
%    	plot(x, [y1 y2 y3 y4 y5]);
%    	set(gcf, 'name', 'gauss2mf', 'numbertitle', 'off');
% 
%    

function gaussmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% GAUSSMF Gaussian curve membership function.
%    GAUSSMF(X, PARAMS) returns a matrix which is the Gaussian
%    membership function evaluated at X. PARAMS is a 2-element vector
%    that determines the shape and position of this membership function.
%    Specifically, the formula for this membership function is:
% 
%    GAUSSMF(X, [SIGMA, C]) = EXP(-(X - C).^2/(2*SIGMA^2));
%    
%    For example:
% 
%        x = (0:0.1:10)';
%        y1 = gaussmf(x, [0.5 5]);
%        y2 = gaussmf(x, [1 5]);
%        y3 = gaussmf(x, [2 5]);
%        y4 = gaussmf(x, [3 5]);
%        subplot(211); plot(x, [y1 y2 y3 y4]);
%        y1 = gaussmf(x, [1 2]);
%        y2 = gaussmf(x, [1 4]);
%        y3 = gaussmf(x, [1 6]);
%        y4 = gaussmf(x, [1 8]);
%        subplot(212); plot(x, [y1 y2 y3 y4]);
%        set(gcf, 'name', 'gaussmf', 'numbertitle', 'off');
% 
%    

function gbellmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% GBELLMF Generalized bell curve membership function.
%    GBELLMF(X, PARAMS) returns a matrix which is the generalized bell
%    membership function evaluated at X. PARAMS is a 3-element vector
%    that determines the shape and position of this membership function.
%    Specifically, the formula for this membership function is:
% 
%    GBELLMF(X, [A, B, C]) = 1./((1+ABS((X-C)/A))^(2*B));
% 
%    Note that this membership function is an extension to the Cauchy
%    probability dist. function. 
%    
%    For example:
% 
%        x = (0:0.1:10)';
%        y1 = gbellmf(x, [1 2 5]);
%        y2 = gbellmf(x, [2 4 5]);
%        y3 = gbellmf(x, [3 6 5]);
%        y4 = gbellmf(x, [4 8 5]);
%        subplot(211); plot(x, [y1 y2 y3 y4]);
%        y1 = gbellmf(x, [2 1 5]);
%        y2 = gbellmf(x, [2 2 5]);
%        y3 = gbellmf(x, [2 4 5]);
%        y4 = gbellmf(x, [2 8 5]);
%        subplot(212); plot(x, [y1 y2 y3 y4]);
%        set(gcf, 'name', 'gbellmf', 'numbertitle', 'off');
% 
%    

function pimf
%MATLAB Tour Partial Function Help:  fuz_con
%
% PIMF Pi-shaped curve membership function.
%    PIMF(X, PARAMS) returns a matrix which is the Pi-shaped
%    membership function evaluated at X. PARAMS = [A B C D] is a 4-element
%    vector that determines the break points of this membership function.
%    The parameters a and d locate the "feet" of the curve, while b and c locate 
%    its "shoulders".
%    Specifically, this MF is the product of SMF and ZMF:
% 
%    PIMF(X, PARAMS) = SMF(X, PARAMS(1:2)).*ZMF(X, PARAMS(3:4))
% 
%    Note that this Pi MF could be asymmetric because it has four
%    parameters. This is different from the conventional Pi MF that uses
%    only two parameters.
%    
%    For example:
% 
%        x = (0:0.1:10)';
%        y1 = pimf(x, [1 4 9 10]);
%        y2 = pimf(x, [2 5 8 9]);
%        y3 = pimf(x, [3 6 7 8]);
%        y4 = pimf(x, [4 7 6 7]);
%        y5 = pimf(x, [5 8 5 6]);
%        plot(x, [y1 y2 y3 y4 y5]);
%        set(gcf, 'name', 'pimf', 'numbertitle', 'off');
% 
%    

function psigmf
%MATLAB Tour Partial Function Help:  fuz_con
%
%  PSIGMF Product of two sigmoid membership functions.
%        PSIGMF(X, PARAMs) returns a matrix Y which is the product of two
%    sigmoid functions evaluated at X. PARAMS is a 4-element vector
%    that determines the shape and position of this membership function.
%    Specifically, X and PARAMS are passed to SIGMF as follows:
% 
%    PSIGMF(X, PARAMS) = SIGMF(X, PARAMS(1:2)).*SIGMF(X, PARAMS(3:4));
%    
%    For example:
% 
%        x = (0:0.2:10)';
%        params1 = [2 3];
%        y1 = sigmf(x, params1);
%        params2 = [-5 8];
%        y2 = sigmf(x, params2);
%        y3 = psigmf(x, [params1 params2]);
%        subplot(211);
%        plot(x, y1, x, y2); title('sigmf');
%        subplot(212);
%        plot(x, y3, 'g-', x, y3, 'o'); title('psigmf');
%        set(gcf, 'name', 'psigmf', 'numbertitle', 'off');
% 
%    

function smf
%MATLAB Tour Partial Function Help:  fuz_con
%
% SMF S-shaped curve membership function.
%    SMF(X, PARAMS) returns a matrix which is the S-shaped
%    membership function evaluated at X. PARAMS = [X0 X1] is a 2-element
%    vector that determines the break points of this membership function.
%    When X0 < X1, SMF is a smooth transition from 0 (at X0) to 1 (at X1).
%    When X0 >= X1, SMF becomes a step function which jumps from 0 to 1
%    at (X0+X1)/2.
%    
%    For example:
% 
%        x = 0:0.1:10;
%        subplot(311); plot(x, smf(x, [2 8]));
%        subplot(312); plot(x, smf(x, [4 6]));
%        subplot(313); plot(x, smf(x, [6 4]));
%        set(gcf, 'name', 'smf', 'numbertitle', 'off');
% 
%    

function sigmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% SIGMF Sigmoid curve membership function.
%    SIGMF(X, PARAMS) returns a matrix which is the sigmoid
%    membership function evaluated at X. PARAMS is a 2-element vector
%    that determines the shape and position of this membership function.
%    Specifically, the formula for this membership function is:
% 
%    SIGMF(X, [A, C]) = 1./(1 + EXP(-A*(X-C)))
% 
%    For example:
% 
%        x = (0:0.2:10)';
%        y1 = sigmf(x, [-1 5]);
%        y2 = sigmf(x, [-3 5]);
%        y3 = sigmf(x, [4 5]);
%        y4 = sigmf(x, [8 5]);
%        subplot(211); plot(x, [y1 y2 y3 y4]);
%        y1 = sigmf(x, [5 2]);
%        y2 = sigmf(x, [5 4]);
%        y3 = sigmf(x, [5 6]);
%        y4 = sigmf(x, [5 8]);
%        subplot(212); plot(x, [y1 y2 y3 y4]);
%        set(gcf, 'name', 'sigmf', 'numbertitle', 'off');
% 
%    

function trapmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% TRAPMF Trapezoidal membership function.
%    TRAPMF(X, PARAMS) returns a matrix which is the trapezoidal
%    membership function evaluated at X. PARAMS = [A B C D] is a 4-element
%    vector that determines the break points of this membership function.
%    We require that A <= B and C <= D. If B >= C, this membership
%    function becomes a trianglular membership function that could have
%    a height less than unity. (See the example below.)
% 
%    For example:
% 
%        x = (0:0.1:10)';
%        y1 = trapmf(x, [2 3 7 9]);
%        y2 = trapmf(x, [3 4 6 8]);
%        y3 = trapmf(x, [4 5 5 7]);
%        y4 = trapmf(x, [5 6 4 6]);
%        plot(x, [y1 y2 y3 y4]);
%        set(gcf, 'name', 'trapmf', 'numbertitle', 'off');
% 
%    

function trimf
%MATLAB Tour Partial Function Help:  fuz_con
%
% TRIMF Triangular membership function.
%    TRIMF(X, PARAMS) returns a matrix which is the triangular
%    membership function evaluated at X. PARAMS = [A B C] is a 3-element
%    vector that determines the break points of this membership function.
%    Usually we require A <= B <= C.
% 
%    Note that this MF always has a height of unity. To have a triangular
%    MF with a height less than unity, use TRAPMF instead.
% 
%    For example:
% 
%        x = (0:0.2:10)';
%        y1 = trimf(x, [3 4 5]);
%        y2 = trimf(x, [2 4 7]);
%        y3 = trimf(x, [1 4 9]);
%        subplot(211), plot(x, [y1 y2 y3]);
%        y1 = trimf(x, [2 3 5]);
%        y2 = trimf(x, [3 4 7]);
%        y3 = trimf(x, [4 5 9]);
%        subplot(212), plot(x, [y1 y2 y3]);
%        set(gcf, 'name', 'trimf', 'numbertitle', 'off');
% 
%    

function zmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% ZMF Z-shaped curve membership function.
%    ZMF(X, PARAMS) returns a matrix which is the Z-shaped
%    membership function evaluated at X. PARAMS = [X1 X0] is a 2-element
%    vector that determines the break points of this membership function.
%    When X1 < X0, ZMF is a smooth transition from 1 (at X1) to 0 (at X0).
%    When X1 >= X0, ZMF becomes a reverse step function which jumps from 1
%    to 0 at (X0+X1)/2.
%    
%    For example:
% 
%        x = 0:0.1:10;
%        subplot(311); plot(x, zmf(x, [2 8]));
%        subplot(312); plot(x, zmf(x, [4 6]));
%        subplot(313); plot(x, zmf(x, [6 4]));
%        set(gcf, 'name', 'zmf', 'numbertitle', 'off');
% 
%    

function addmf
%MATLAB Tour Partial Function Help:  fuz_con
%
%   Synopsis
%   a = addmf(a,varType,varIndex,mfName,mfType,mfParams)
%   
%   Description
%   A membership function can only be added to a variable name for an FIS that 
%   already exists. Indices are assigned to membership functions in the order 
%   in which they are added, so the first membership function added to a 
%   variable will always be known as membership function number one for that 
%   variable. You cannot add a membership function to input variable number two 
%   of a system if only one input has been defined. 
%   The function requires six input arguments in this order: 
%       A MATLAB variable name of a FIS structure in the workspace 
%       A string representing the type of the variable you want to add the 
%          membership function to (input or output)
%       The index of the variable you want to add the membership function to
%       A string representing the name of the new membership function
%       A string representing the type of the new membership function
%       The vector of parameters that specify the membership function.
%   
%   Example
%   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]);
%   plotmf(a,'input',1)
%   
%   

function addrule
%MATLAB Tour Partial Function Help:  fuz_con
%
%    Purpose
%    Add a rule to an FIS.
% 
%    Synopsis
%    a = addrule(a,ruleList)
% 
%    Description
%    addrule has two arguments. The first argument is the FIS name. The second
%    argument for addrule is a matrix of one or more rows, each of which
%    represents a given rule. The format that the rule list matrix must take is
%    very specific. If there are m inputs to a system and n outputs, there must
%    be exactly m + n + 2 columns to the rule list.
%    The first m columns refer to the inputs of the system. Each column contains
%    a number that refers to the index of the membership function for that
%    variable.
%    The next n columns refer to the outputs of the system. Each column contains
%    a number that refers to the index of the membership function for that
%    variable.
%    The m + n + 1 column contains the weight that is to be applied to the rule.
%    The weight must be a number between zero and one, and is generally left as
%    one.
%    The m + n + 2 column contains a 1 if the fuzzy operator for the rule*s
%    antecedent is AND. It contains a 2 if the fuzzy operator is OR.
%    Example
%    ruleList=[
%    	1 1 1 1 1
%    	1 2 2 1 1];
%    a = addrule(a,ruleList);
%    If the above system a has two inputs and one output, the first rule can be
%    interpreted as: *If input 1 is MF 1 and input 2 is MF 1, then output 1 is
%    MF 1.*
% 
%    

function addvar
%MATLAB Tour Partial Function Help:  fuz_con
%
%    Purpose
%    Add a variable to an FIS.
% 
%    Synopsis
%    a = addvar(a,varType,varName,varBounds)
% 
%    Description
%    addvar has four arguments in this order:
%    the FIS name
%    the type of the variable (input or output)
%    the name of the variable
%    the vector describing the limiting range for the variable
%    Indices are applied to variables in the order in which they are added, so
%    the first input variable added to a system will always be known as input
%    variable number one for that system. Input and output variables are
%    numbered independently.
% 
%    Example
%    a=newfis('tipper');
%    a=addvar(a,'input','service',[0 10]);
%    getfis(a,'input',1)
%    MATLAB replies
%    	Name = service
%    	NumMFs = 0
%    	MFLabels =
%    	Range = [0 10]
% 
%    

function defuzz
%MATLAB Tour Partial Function Help:  fuz_con
%
%  DEFUZZ Defuzzify membership function.
%    Synopsis
%    out = defuzz(x,mf,type)
%    Description
%    defuzz(x,mf,type) returns a defuzzified value out, of a membership function
%    mf positioned at associated variable value x, using one of several
%    defuzzification strategies, according to the argument, type. The variable
%    type can be one of the following.
%    centroid: centroid of area method.
%    bisector: bisector of area method.
%    mom: mean of maximum method.
%    som: smallest of maximum method.
%    lom: largest of maximum method.
%    If type is not one of the above, it is assumed to be a user-defined
%    function. x and mf are passed to this function to generate the defuzzified
%    output.
%    Examples
%    x = -10:0.1:10;
%    mf = trapmf(x,[-10 -8 -4 7]);
%    xx = defuzz(x,mf,'centroid');
% 
%    Try DEFUZZDM for more examples.

function evalfis
%MATLAB Tour Partial Function Help:  fuz_con
%
%  EVALFIS    Perform fuzzy inference calculations.
%    Synopsis
%    output= evalfis(input,fismat)
%    output= evalfis(input,fismat, numPts)
%    [output, IRR, ORR, ARR]= evalfis(input,fismat)
%    [output, IRR, ORR, ARR]= evalfis(input,fismat, numPts)
%    Description
%    evalfis has the following arguments:
%    input: a number or a matrix specifying input values. If input is an M-by-N
%    matrix, where N is number of input variables, then evalfis takes each row
%    of input as an input vector and returns the M-by-L matrix to the variable,
%    output, where each row is an output vector and L is the number of output
%    variables.
%    fismat: an FIS structure to be evaluated.
%    numPts: an optional argument which represents the number of sample points
%    on which to evaluate the membership functions over the input or output
%    range. If this argument is not used, the default value of 101 point is
%    used.
%    The range labels for evalfis are as follows:
%    output: the output matrix of size M-by-L, where M represents the number of
%    input values specified above, and L is the number of output variables for
%    the FIS.
%    The optional range variables for evalfis are only calculated when the input
%    argument is a row vector, (only one set of inputs is applied). These
%    optional range variables are:
%    IRR: the result of evaluating the input values through the membership
%    functions. This is a matrix of size numRules-by-N, where numRules is the
%    number of rules, and N is the number of input variables.
%    ORR: the result of evaluating the output values through the membership
%    functions. This is a matrix of size numPts-by-numRules*L, where numRules is
%    the number of rules, and L is the number of outputs. The first numRules
%    columns of this matrix correspond to the first output, the next numRules
%    columns of this matrix correspond to the second output, and so forth.
%    ARR: the numPts-by-L matrix of the aggregate values sampled at numPts
%    alongthe output range for each output.
%    When invoked with only one range variable, this function computes the
%    output vector output of the fuzzy inference system specified by the matrix
%    fismat for the input value specified by the number or matrix, input. This
%    computation is The optional argument
%    Example
%    fismat = readfis('tipper');
%    out = evalfis([2 1; 4 9],fismat)
%    This generates the response
%    out =
%    	7.0169
%    	19.6810
%    

function evalmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% EVALMF Evaluate membership function.
% EVALMF Generic membership function evaluation.
%    Synopsis
%    y = evalmf(x,mfParams,mfType)
%    Description
%    evalmf evaluates any membership function, where x is the variable range for
%    the membership function evaluation, mfType is a membership function from
%    the toolbox, and mfParams are appropriate parameters for that function.
%    If you want to create your own custom membership function, evalmf will
%    still work, because it will still evaluate any membership function whose
%    name it doesn’t recognize.
%    Examples
%    x=0:0.1:10;
%    mfparams = [2 4 6];
%    mftype = 'gbellmf';
%    y=evalmf(x,mfparams,mftype);
%    plot(x,y)
%    xlabel('gbellmf, P=[2 4 6]')
% 
%    

function gensurf
%MATLAB Tour Partial Function Help:  fuz_con
%
% GENSURF Generate an FIS output surface.
%    Synopsis
%    gensurf(fis)
%    gensurf(fis,inputs,output)
%    gensurf(fis,inputs,output,grids,refinput)
%    
%    Description
%    gensurf(fis) generates a plot of the output surface of a given fuzzy
%    inference system (fis) using the first two inputs and the first output.
% 
%    gensurf(fis,inputs,output) generates a plot using the inputs (one or two)
%    and output (only one is allowed) given, respectively, by the vector,
%    inputs, and the scalar, output.
% 
%    gensurf(fis,inputs,output,grids) allows you to specify the number of grids
%    in the X (first, horizontal) and Y (second, vertical) directions. If grids
%    is a two element vector, the grids in the X and Y directions can be set
%    independently.
% 
%    gensurf(fis,inputs,output,grids,refinput) can be used if there are more 
%    than two outputs. The length of the vector refinput is the same as the 
%    number of inputs. Use NaNs for the entries of refinput corresponding to the 
%    inputs whose surface is being displayed, and real double values to fix the 
%    values of other inputs. 
% 
%    [x,y,z]=gensurf(...) returns the variables that define the output surface
%    and suppresses automatic plotting.
%  
%    Examples
%    a = readfis('tipper');
%    gensurf(a)
% 
%    

function getfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% GETFIS Get fuzzy inference system properties.
%    OUT = GETFIS(FIS) returns a list of general information about the
%    fuzzy inference system FIS. OUT = GETFIS(FIS,'fisProp') returns 
%    the current value of the FIS property called 'fisProp'.
% 
%    For example:
% 
%            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,'excellent','gaussmf',[1.5 10]);
%            getfis(a)
% 
%    

function mf2mf
%MATLAB Tour Partial Function Help:  fuz_con
%
% MF2MF Translates parameters between membership functions.
%    Synopsis
%    outParams = mf2mf(inParams,inType,outType)
%    
%    Description
%    This function translates any built-in membership function type into 
%    another, in terms of its parameter set. mf2mf tries to mimic the symmetry 
%    points for both the new and old membership functions. Occasionally this 
%    translation results in lost information, so that if the output parameters 
%    are translated back into the original membership function type, the 
%    transformed membership function will not look the same as it did 
%    originally. 
%    The input arguments for mf2mf are as follows: 
%    inParams: The parameters of the membership function you are transforming
%    inType: a string name for the type of membership function you are 
%    transforming
%    outType: a string name for the new membership function you are transforming 
%    to.
%    Examples
%    x=0:0.1:5;
%    mfp1 = [1 2 3];
%    mfp2 = mf2mf(mfp1,'gbellmf','trimf');
%    plot(x,gbellmf(x,mfp1),x,trimf(x,mfp2))
% 
%    

function newfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% NEWFIS Create new FIS.
%    FIS=NEWFIS(FISNAME) creates a new Mamdani-style FIS structure
% 
%    FIS=NEWFIS(FISNAME, FISTYPE) creates a FIS structure for a Mamdani or 
%    Sugeno-style system with the name FISNAME.
% 
%    

function parsrule
%MATLAB Tour Partial Function Help:  fuz_con
%
% PARSRULE Parse fuzzy rules.
%    This function parses the text that defines the rules (txtRuleList) for a 
%    fuzzy system (fis) and returns a FIS structure with the appropriate rule 
%    list in place. If the original input FIS structure, fis, has any rules 
%    initially, they are replaced in the new matrix fis2. Three different rule 
%    formats (indicated by ruleFormat) are supported: *verbose*, *symbolic*, and 
%    *indexed*. The default format is *verbose*. When the optional language 
%    argument (lang) is used, the rules are parsed in verbose mode, assuming the 
%    key words are in the language, lang. This language must be either 
%    'english', 'francais', or 'deutsch'. The key language words in English are: 
%    IF, THEN, IS, AND, OR, and NOT. 
%    
%    outFIS = PARSRULE(inFIS,inRuleList) parses the rules in the string
%    matrix inRuleList and returns the updated FIS matrix outFIS. 
% 
%    outFIS = PARSRULE(inFIS,inRuleList,ruleFormat) parses the rules using
%    the given ruleFormat.
% 
%    outFIS = PARSRULE(inFIS,inRuleList,ruleFormat,lang) parses the 
%    rules in verbose mode assuming the key words are in the language, lang.
% 
%    For example:
% 
%            a=newfis('tipper');
%            a=addvar(a,'input','service',[0 10]);
%            a=addmf(a,'input',1,'poor','gaussmf',[1.5 0]);
%            a=addvar(a,'input','food',[0 10]);
%            a=addmf(a,'input',2,'rancid','trapmf',[-2 0 1 3]);
%            a=addvar(a,'output','tip',[0 30]);
%            a=addmf(a,'output',1,'cheap','trimf',[0 5 10]);
%            rule1='if service is poor or food is rancid then tip is cheap';
%            a=parsrule(a,rule1);
%            showrule(a)
%    
%    

function plotfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% PLOTFIS Display FIS input-output diagram.
%    PLOTFIS(FISSTRUCT) creates an input-output display of the fuzzy
%    inference system associated with the FIS structure FISSTRUCT. 
%    Inputs and their membership functions appear to the left of 
%    the FIS structural characteristics, while outputs and their 
%    membership functions appear on the right.
% 
%    This FIS diagram is similar to the one shown at the top of the 
%    FIS Editor (invoked by the command FUZZY).
% 
%    For example:
% 
%            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,'excellent','gaussmf',[1.5 10]);
%            a=addvar(a,'input','food',[0 10]);
%            a=addmf(a,'input',2,'rancid','trapmf',[-2 0 1 3]);
%            a=addmf(a,'input',2,'delicious','trapmf',[7 9 10 12]);
%            a=addvar(a,'output','tip',[0 30]);
%            a=addmf(a,'output',1,'cheap','trimf',[0 5 10]);
%            a=addmf(a,'output',1,'generous','trimf',[20 25 30]);
%            ruleList=[1 1 1 1 2; 2 2 2 1 2 ];
%            a=addrule(a,ruleList);
%            plotfis(a)
% 
%    

function plotmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% PLOTMF Display all of the membership functions for a given variable.
%    PLOTMF(fismat,varType,varIndex) plots all of the membership functions
%    in the FIS called fismat associated with a given variable whose type 
%    (input or output) and index are respectively given by varType and 
%    varIndex. This function can also be used with the MATLAB function
%    subplot.
% 
%    [xOut,yOut]=PLOTMF(fismat,varType,varIndex) returns the x and y data
%    points associated with the membership functions without plotting them.
% 
%    PLOTMF(fismat,varType,varIndex,numPts) generates the same plot with
%    exactly numPts points plotted along the curve.
% 
%    For example:
% 
%            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]);
%            plotmf(a,'input',1)
% 
%    

function readfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% READFIS Load FIS from disk.
%    FISMAT=FISWRITE('filename') creates a FIS matrix in the
%    workspace corresponding to the FIS file 'filename' on disk.
% 
%    FISMAT=READFIS brings up a UIGETFILE dialog box to assist
%    with the name and directory location of the file.
% 
%    The extension '.fis' is assumed for 'filename' if it is not 
%    already present.
% 
%    

function rmmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% RMMF   Remove membership function from FIS.
%    fis2 = RMMF(fis,varType,varIndex,'mf',mfIndex) removes the
%    specified membership function from the fuzzy inference system
%    associated with the FIS matrix fis.
% 
%    For example:
% 
%            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]);
%            subplot(2,1,1), plotmf(a,'input',1)
%            a=rmmf(a,'input',1,'mf',2);
%            subplot(2,1,2), plotmf(a,'input',1)
% 
%    

function rmvar
%MATLAB Tour Partial Function Help:  fuz_con
%
% RMVAR  Remove variable from FIS.
%    fis2 = RMVAR(fis,varType,varIndex) removes the specified
%    variable from the fuzzy inference system associated with the 
%    FIS matrix fis.
% 
%    [fis2,errorStr] = RMVAR(fis,varType,varIndex) returns any necessary
%    error messages in the string errorStr.
% 
%    For example:
% 
%            a=newfis('tipper');
%            a=addvar(a,'input','service',[0 10]);
%            a=addvar(a,'input','food',[0 10]);
%            getfis(a)
%            a=rmvar(a,'input',1);
%            getfis(a)
% 
%    

function setfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% SETFIS Set fuzzy inference system properties.
%    FIS2 = SETFIS(FIS1,'fisPropName',newPropValue) returns the FIS matrix
%    FIS2 which is identical to FIS1 except that the FIS property 
%    corresponding to 'fisPropName' is set to newPropValue.
% 
%    FIS2 = SETFIS(FIS1,varType,varIndex,'varPropName',newPropValue)
%    returns FIS2, in which a property associated with the variable
%    specified by varType and varIndex has been set to a new value.
% 
%    FIS2 = SETFIS(FIS1,varType,varIndex,'mf',mfIndex, ...
%            'mfPropName',newPropValue) returns FIS2, in which a property 
%    associated with the membership function specified by varType,
%    varIndex, and mfIndex has been set to a new value.
% 
% 
%    

function showfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% SHOWFIS Display annotated FIS.
%    SHOWFIS(fismat) displays a text version of the variable
%    fismat annotated row by row, allowing you to see the 
%    significance and contents of each field of the structure.
% 
%    For example:
% 
%            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,'excellent','gaussmf',[1.5 10]);
%            showfis(a)
% 
%    

function showrule
%MATLAB Tour Partial Function Help:  fuz_con
%
% SHOWRULE Display FIS rules.
%    SHOWRULE(FIS) displays all rules in verbose format for the 
%    fuzzy inference system associated with the matrix FIS.
%    
%    SHOWRULE(FIS,ruleIndex) displays rules specified by the
%    vector ruleIndex.
%    
%    SHOWRULE(FIS,ruleIndex,ruleFormat) displays rules using the
%    rule format specified by ruleFormat, which can be one of three
%    possibilities: 'verbose' (the default), 'symbolic' (which is
%    language neutral), and 'indexed' (for membership function index 
%    referencing).
% 
%    SHOWRULE(fis,ruleIndex,ruleFormat,lang) displays the rules
%    in verbose mode assuming the key words are in the language given
%    by lang, which must be either 'english', 'francais', or 'deutsch'.
%    Key words are (in English) IF, THEN, IS, AND, OR, and NOT.
% 
%    For example:
% 
%            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,'excellent','gaussmf',[1.5 10]);
%            a=addvar(a,'input','food',[0 10]);
%            a=addmf(a,'input',2,'rancid','trapmf',[-2 0 1 3]);
%            a=addmf(a,'input',2,'delicious','trapmf',[7 9 10 12]);
%            a=addvar(a,'output','tip',[0 30]);
%            a=addmf(a,'output',1,'cheap','trimf',[0 5 10]);
%            a=addmf(a,'output',1,'generous','trimf',[20 25 30]);
%            ruleList=[1 1 1 1 2; 2 2 2 1 2 ];
%            a=addrule(a,ruleList);
%            showrule(a,[2 1],'symbolic')
% 
%    

function writefis
%MATLAB Tour Partial Function Help:  fuz_con
%
% WRITEFIS Save a FIS to disk.
%    WRITEFIS(FISMAT) brings up a dialog box to assist with the 
%    naming and directory location of the file.
% 
%    WRITEFIS(FISMAT,'filename') writes a FIS file corresponding
%    to the FIS matrix FISMAT to a disk file called 'filename'. 
%    No dialog box is used and the file is saved to the current 
%    directory.
% 
%    WRITEFIS(FISMAT,'filename','dialog') brings up a dialog box 
%    with the default name filename.fis supplied.
%    The extension .fis is only added to filename if it is not 
%    already included in the name.
% 
%    

function anfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% ANFIS   Training routine for Sugeno-type FIS (MEX only).
%    Synopsis
%    [fismat,error1,stepsize] = anfis(trnData)
%    [fismat,error1,stepsize] = anfis(trnData,fismat)
%    [fismat1,error1,stepsize] = ...
%    anfis(trnData,fismat,trnOpt,dispOpt)
%    [fismat1,error1,stepsize,fismat2,error2] = ...
%    anfis(trnData,fismat, trnOpt,dispOpt,chkData)
%    [fismat1,error1,stepsize,fismat2,error2] = ...
%    anfis(trnData,fismat, trnOpt,dispOpt,chkData,optMethod)
%    
%    Description
%    This is the major training routine for Sugeno-type fuzzy inference systems.
%    anfis uses a hybrid learning algorithm to identify parameters of
%    Sugeno-type fuzzy inference systems. It applies a combination of the
%    least-squares method and the backpropagation gradient descent method for
%    training FIS membership function parameters to emulate a given training
%    data set. anfis can also be invoked using an optional argument for model
%    validation. The type of model validation that takes place with this option
%    is a checking for model overfitting, and the argument is a data set called
%    the checking data set.
%    The arguments in the above description for anfis are as follows:
%    trnData: the name of a training data set. This is a matrix with all but the
%    last column containing input data, while the last column contains a single
%    vector of output data.
%    fismat: the name of an FIS, (fuzzy inference system) used to provide anfis
%    with an initial set of membership functions for training. Without this
%    option, anfis will use genfis1 to implement a default initial FIS for
%    training. This default FIS will have two membership functions of the
%    Gaussian type, when invoked with only one argument. If fismat is provided
%    as a single number (or a vector), it is taken as the number of membership
%    functions (or the vector whose entries are the respective numbers of
%    membership functions associated with each respective input, when these
%    numbers differ for each input). In this case, both  arguments of anfis are
%    passed to genfis1 to generate a valid FIS matrix before starting the
%    training process.
%    trnOpt: vector of training options. When any training option is entered as
%    NaN the default options will be in force. These options are as follows:
%    trnOpt(1): training epoch number (default: 10)
%    trnOpt(2): training error goal (default: 0)
%    trnOpt(3): initial step size (default: 0.01)
%    trnOpt(4): step size decrease rate (default: 0.9)
%    trnOpt(5): step size increase rate (default: 1.1)
%    dispOpt: vector of display options that specify what message to display in
%    the MATLAB command window during training. The default value for any
%    display option is 1, which means the corresponding information is
%    displayed. A 0 means the corresponding information is not displayed on the
%    screen. When any display option is entered as NaN, the default options will
%    be in force. These options are as follows:
%    dispOpt(1): ANFIS information, such as numbers of input and output
%    membership functions, and so on (default: 1)
%    dispOpt(2): error (default: 1)
%    dispOpt(3): step size at each parameter update (default: 1)
%    dispOpt(4): final results (default: 1)
%    chkData: the name of an optional checking data set for overfitting model
%    validation. This data set is a matrix in the same format as the training
%    data set.
%    optMethod: optional optimization method used in membership function
%    parameter training: either 1 for the hybrid method or 0 for the
%    backpropagation method. The default method is the hybrid method, which is a
%    combination of least squares estimation with backpropagation. The default
%    method is invoked whenever the entry for this argument is anything but 0.
%    The training process stops whenever the designated epoch number is reached
%    or the training error goal is achieved.
%    Note on anfis arguments:
%    When anfis is invoked with two or more arguments, any optional arguments
%    will take on their default values if they are entered as NaNs or empty
%    matrices. Default values can be changed directly by modifying the file
%    anfis.m. NaNs or empty matrices must be used as place-holders for variables
%    if you don’t want to specify them, but do want to specify succeeding
%    arguments, for example, when you implement the checking data option of
%    anfis.
%    The range variables in the above description for anfis are as follows:
%    fismat1 is the FIS structure whose parametes are set according to a minimum
%    training error criterion.
%    error1 or error2 is an array of root mean squared errors, representing the
%    training data error signal and the checking data error signal,
%    respectively.
%    stepsize is an array of step sizes. The step size is decreased (by
%    multiplying it with the component of the training option corresponding to
%    the step size decrease rate) if the error measure undergoes two consecutive
%    combinations of an increase followed by a decrease. The step size is
%    increased (by multiplying it with the increase rate) if the error measure
%    undergoes four consecutive decreases.
%    fismat2 is the FIS structure whose parametes are set according to a minimum
%    checking error criterion.
%    Example
%    x = (0:0.1:10)';
%    y = sin(2*x)./exp(x/5);
%    trnData = [x y];
%    numMFs = 5;
%    mfType = 'gbellmf';
%    epoch_n = 20;
%    in_fismat = genfis1(trnData,numMFs,mfType);
%    out_fismat = anfis(trnData,in_fismat,20);
%    plot(x,y,x,evalfis(x,out_fismat));
%    legend('Training Data','ANFIS Output');
% 
%    References
% 
%    Jang, J.-S. R., “Fuzzy Modeling Using Generalized Neural Networks and
%    Kalman Filter Algorithm,” Proc. of the Ninth National Conf. on Artificial
%    Intelligence (AAAI-91), pp. 762-767, July 1991.
%    Jang, J.-S. R., “ANFIS: Adaptive-Network-based Fuzzy Inference Systems,”
%    IEEE Transactions on Systems, Man, and Cybernetics, Vol. 23, No. 3, pp.
%    665-685, May 1993.
% 
%    

function fcm
%MATLAB Tour Partial Function Help:  fuz_con
%
%  FCM Find clusters with fuzzy c-means clustering.
%  FCM Fuzzy c-means clustering.
%    Synopsis
%    [center,U,obj_fcn] = fcm(data,cluster_n)
%    Description
%    [center, U, obj_fcn] = fcm(data, cluster_n) applies the fuzzy c-means
%    clustering method to a given data set.
%    The input arguments of this function are:
%    data: data set to be clustered; each row is a sample data point
%    cluster_n: number of clusters (greater than one)
%    The output arguments of this function are:
%    center: final cluster centers, where each row is a center
%    U: final fuzzy partition matrix (or membership function matrix)
%    obj_fcn: values of the objective function during iterations
%    fcm(data,cluster_n,options) uses an additional argument variable, options,
%    to control clustering parameters, introduce a stopping criteria, and/or set
%    the iteration information display:
%    options(1): exponent for the partition matrix U (default: 2.0)
%    options(2): maximum number of iterations (default: 100)
%    options(3): minimum amount of improvement (default: 1e-5)
%    options(4): info display during iteration (default: 1)
%    If any entry of options is NaN, the default value for that option is used
%    instead. The clustering process stops when the maximum number of iteration
%    is reached, or when the objective function improvement between two
%    consecutive iteration is less than the minimum amount of improvement
%    specified.
%    Example
%    data = rand(100, 2);
%    [center,U,obj_fcn] = fcm(data, 2);
%    plot(data(:,1), data(:,2),'o');
%    maxU = max(U);
%    index1 = find(U(1,:) == maxU);
%    index2 = find(U(2, :) == maxU);
%    line(data(index1,1),data(index1,2), ...
%    	'marker','*','color','g');
%    line(data(index2,1),data(index2,2), ...
%    	'marker','*','color','r');
% 
%    

function genfis1
%MATLAB Tour Partial Function Help:  fuz_con
%
%  GENFIS1 Generates a Sugeno-type FIS structure used in ANFIS training.
%    Synopsis
%    fismat = genfis1(data)
%    fismat = genfis1(data,numMFs,inmftype, outmftype)
%    Description
%    genfis1 generates a Sugeno-type FIS structure used as initial conditions
%    (initialization of the membership function parameters) for anfis training.
%    
%    genfis1(data, numMFs, inmftype, outmftype) generates a FIS structure from a
%    training data set, data, using a grid partition on the data (no
%    clustering). The output membership functions FIS generated by genfis1
%    The arguments for genfis1 are as follows:
%    data is the training data matrix, which must be entered with all the last
%    column representing input data, and the last column representing the single
%    output.
%    numMFs is a vector whose coordinates specify the number of membership
%    functions associated with each input. If you want the same number of
%    membership functions to be associated with each input, then it suffices to
%    make numMFs a single number.
%    inmftype is a string array in which each row specifies the membership
%    function type associated with each input. Again, this can be one
%    dimensional single string if the type of membership functions associated
%    with each input is the same.
%    outmftype is a string that specifies the membership function type
%    associated with the output. There can only be one output, since this is a
%    Sugeno-type system. The output membership function type must be either
%    linear or constant.
%    The number of membership functions associated with the output is the same
%    as the number of rules generated by genfis1. The default number of
%    membership functions, numMFs, is 2; the default input or output membership
%    function type is 'gbellmf'. These are used whenever genfis1 is invoked
%    without the last three arguments.
%    Example
%    data = [rand(10,1) 10*rand(10,1)-5 rand(10,1)];
%    numMFs = [3 7];
%    mfType = str2mat('pimf','trimf');
%    fismat = genfis1(data,numMFs,mfType);
%    [x,mf] = plotmf(fismat,'input',1);
%    subplot(2,1,1), plot(x,mf);
%    xlabel('input 1 (pimf)');
%    [x,mf] = plotmf(fismat,'input',2);
%    subplot(2,1,2), plot(x,mf);
%    xlabel('input 2 (trimf)');
% 		
%    

function genfis2
%MATLAB Tour Partial Function Help:  fuz_con
%
% GENFIS2 Generate an FIS structure from data using subtractive clustering.
%    Synopsis
%    fismat = genfis2(Xin,Xout,radii)
%    fismat = genfis2(Xin,Xout,radii,xBounds)
%    fismat = genfis2(Xin,Xout,radii,xBounds,options)
%    Description
%    Given separate sets of input and output data, genfis2 generates an FIS
%    using fuzzy subtractive clustering. When there is only one output, genfis2
%    may be used to generate an initial FIS for anfis training by first
%    implementing subtractive clustering on the data. genfis2 accomplishes this
%    by extracting a set of rules that models the data behavior. The rule
%    extraction method first uses the subclust function to determine the number
%    of rules and antecedent membership functions and then uses linear least
%    squares estimation to determine each rule’s consequent equations. This
%    function returns an FIS structure that contains a set of fuzzy rules to
%    cover the feature space.
%    The arguments for genfis2 are as follows:
%    Xin is a matrix in which each row contains the input values of a data
%    point.
%    Xout is a matrix in which each row contains the output values of a data
%    point.
%    radii is a vector that specifies a cluster center’s range of influence in
%    each of the data dimensions, assuming the data falls within a unit
%    hyperbox. For example, if the data dimension is 3 (e.g., Xin has 2 columns
%    and Xout has 1 column), radii = [0.5 0.4 0.3] specifies that the ranges of
%    influence in the first, second, and third data dimensions (i.e., the first
%    column of Xin, the second column of Xin, and the column of Xout) are 0.5,
%    0.4, and 0.3 times the width of the data space, respectively. If radii is a
%    scalar, then the scalar value is applied to all data dimensions, i.e., each
%    cluster center will have a spherical neighborhood of influence with the
%    given radius.
%    xBounds is a 2xN optional matrix that specifies how to map the data in Xin
%    and Xout into a unit hyperbox, where N is the data (row) dimension. The
%    first row of xBounds contains the minimum axis range values and the second
%    row contains the maximum axis range values for scaling the data in each
%    dimension. For example, xBounds = [-10 0 -1; 10 50 1] specifies that data
%    values in the first data dimension are to be scaled from the range [-10
%    +10] into values in the range [0 1]; data values in the second data
%    dimension are to be scaled from the range [0 50]; and data values in the
%    third data dimension are to be scaled from the range [-1 +1]. If xBounds is
%    an empty matrix or not provided, then xBounds defaults to the minimum and
%    maximum data values found in each data dimension.
%    options is an optional vector for specifying algorithm parameters to
%    override the default values. These parameters are explained in the help
%    text for the subclust function on page 62. Default values are in place when
%    this argument is not specified.
%    Examples
%    fismat = genfis2(Xin,Xout,0.5)
%    This is the minimum number of arguments needed to use this function. Here a
%    range of influence of 0.5 is specified for all data dimensions.
%    fismat = genfis2(Xin,Xout,[0.5 0.25 0.3])
%    This assumes the combined data dimension is 3. Suppose Xin has two columns
%    and Xout has one column, then 0.5 and 0.25 are the ranges of influence for
%    each of the Xin data dimensions, and 0.3 is the range of influence for the
%    Xout data dimension.
%    fismat = genfis2(Xin,Xout,0.5,[-10 -5 0; 10 5 20])
%    This specifies how to normalize the data in Xin and Xout into values in the
%    range [0 1] for processing. Suppose Xin has two columns and Xout has one
%    column, then the data in the first column of Xin are scaled from [-10 +10],
%    the data in the second column of Xin are scaled from [-5 +5], and the data
%    in Xout are scaled from [0 20].
% 
%    A full description of the rule extraction algorithm can be found in: 
%    S. Chiu, "Fuzzy Model Identification Based on Cluster Estimation," J. of
%    Intelligent & Fuzzy Systems, Vol. 2, No. 3, 1994.
% 
%    

function subclust
%MATLAB Tour Partial Function Help:  fuz_con
%
% SUBCLUST Find cluster centers with substractive clustering.
% 	Usage of this function is [C,S] = SUBCLUST(X,RADII,XBOUNDS,OPTIONS).
% 	For a matrix X in which each row contains a data point, this function
% 	estimates the cluster centers by using the "Subtractive Clustering
% 	Method".  RADII is a vector that specifies a cluster center's range of
% 	influence in each of the data dimensions, assuming the data falls
% 	within a unit hyperbox.  For example, if the data dimension is 2
% 	(X has 2 columns), RADII = [0.5 0.25] specifies that the range of
% 	influence in the first data dimension is half the width of the data
% 	space and the range of influence in the second data dimension is one
% 	quarter the width of the data space.  If RADII is a scalar, then the
% 	scalar value is applied to all data dimensions, i.e., each cluster 
% 	center will have a spherical neighborhood of influence with the given
% 	radius.  XBOUNDS is a 2xN matrix that specifies how to map the data in
% 	X into a unit hyperbox, where N is the data dimension.  The first row
% 	contains the minimum axis range values and the second row contains the
% 	maximum axis range values for scaling the data in each dimension.
% 	For example, XBOUNDS = [-10 -5; 10 5] specifies that data values in the
% 	first data dimension are to be scaled from the range [-10 +10] into
% 	values in the range [0 1]; data values in the second data dimension are
% 	to be scaled from the range [-5 +5] into values in the range [0 1].
% 	If XBOUNDS is an empty matrix or not provided, then XBOUNDS defaults
% 	to the minimum and maxium data values found in each data dimension.
% 
% 	OPTIONS is an optional vector for specifying clustering algorithm
% 	parameters to override the default values.  These parameters are:
% 	OPTIONS = [SQUASH_FACTOR ACCEPT_RATIO REJECT_RATIO VERBOSE].
% 	SQUASH_FACTOR is used to multiply the RADII values to determine the
% 	neighborhood of a cluster center within which the existence of other
% 	cluster centers are to be discouraged.  For each data point, a measure
% 	of its potential as a cluster center is computed.  The data point with
% 	the highest potential is selected as the first cluster center.
% 	ACCEPT_RATIO sets the potential, as a fraction of the potential of the
% 	first cluster center, above which another data  point will be accepted
% 	as a cluster center.  REJECT_RATIO sets the potential, as a fraction of
% 	the potential of the first cluster center, below which a data point will
% 	be rejected as a cluster center.  If VERBOSE is not zero, then progress
% 	information will be printed as the clustering process proceeds.
% 	The default values for the parameters in the OPTIONS vector are
% 	[1.25 0.5 0.15 0].  The function returns the cluster centers in the
% 	matrix C; each row of C contains the position of a cluster center.
% 	The returned S vector contains the sigma values that specify the range
% 	of influence of a cluster center in each of the data dimensions.
% 	All cluster centers share the same set of sigma values.
% 
% 	Examples:
% 
% 	[C,S] = SUBCLUST(X,0.5)
% 	This is the minimum number of argument needed to use this function.
% 	Here a range of influence of 0.5 is specified for all data dimensions.
% 
% 	[C,S] = SUBCLUST(X,[0.5 0.25 0.3],[],[2.0 0.8 0.7])
% 	This assumes the data dimension is 3 (X has 3 columns) and uses a
% 	range of influence of 0.5, 0.25, and 0.3 for the first, second
% 	and third data dimension, respectively.  The scaling factors for
% 	mapping the data into a unit hyperbox will be obtained from the minimum
% 	and maximum data values.  The SQUASH_FACTOR is set to 2.0, indicating
% 	that we want to only find clusters that are far from each other;
% 	the ACCEPT_RATIO is set to 0.8, indicating that we will only accept
% 	data points that have very strong potential of being cluster centers;
% 	the REJECT_RATIO is set to 0.7, indicating that we want to reject all
% 	data points without a strong potential.
% 
% 	A full description of the clustering algorithm can be found in: 
% 	S. Chiu, "Fuzzy Model Identification Based on Cluster Estimation," J. of
% 	Intelligent & Fuzzy Systems, Vol. 2, No. 3, 1994.
% 
% 	

function convertfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% CONVERTFIS convert v1 fis matrix to v2 fis structure.

function discfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% DISCFIS Discretize a fuzzy inference system.
%    [XI,YI,XO,YO,R] = DISCFIS(fis,numPts) discretizes all the membership
%    functions for the input and output variables of the fuzzy inference
%    system called fis. The columns of XI and YI are the coordinates for the
%    input membership functions, and the columns of XO and YO are the 
%    coordinates for the output membership functions. There are numPts rows
%    in each of XI, YI, XO, and YO.
% 
%    R is an indexed rule list where each element in R is a number that refers
%    to the column in XI and YI, or XO and YO, depending on whether the column
%    in question corresponds to an input variable or an output variable.

function evalmmf
%MATLAB Tour Partial Function Help:  fuz_con
%
% EVALMMF Multiple membership functions evaluation.
%    EVALMMF(X, MF_PARA, MF_TYPE) returns a matrix whose i-th row
%    is the membership grades of MF with type MF_TYPE(i,:) and
%    parameters MF_PARA(i,:).
%    If MF_TYPE is a single string, it will be used for all evaluation.
% 
%    For example:
% 
%        x = 0:0.2:10;
%        para = [-1 2 3 4; 3 4 5 7; 5 7 8 0; 2 9 0 0];
%        type = str2mat('pimf', 'trapmf', 'trimf', 'sigmf');
%        mf = evalmmf(x, para, type);
%        plot(x', mf');
%        set(gcf, 'name', 'evalmmf', 'numbertitle', 'off');
% 
%    

function fstrvcat
%MATLAB Tour Partial Function Help:  fuz_con
%
% FSTRVCAT Form matrix from individual vectors and matrices.
%    AOUT = FSTRVCAT(A1,A2,A3,..) forms the matrix AOUT containing the
%    vectors A1,A2,A3,... as rows.  Automatically pads each string with
%    zeros in order to form a valid matrix.  Up to 11 vectors
%    can be used to form AOUT.  Each vector parameter, Ai, can itself be a 
%    matrix.  This allows the creation of arbitrarily large matrices.
%    Although the inputs A1,A2, ... can be strings, the output AOUT is
%    always cast as a string. This function is used to assemble fuzzy
%    inference system (FIS) matrices.
% 
%    For example:
% 
%            fstrvcat('hello',8,[110 101 100],'blue')

function fuzarith
%MATLAB Tour Partial Function Help:  fuz_con
%
% FUZARITH Fuzzy arithmetics.
% 	C = FUZARITH(X, A, B, OPERATOR) returns a fuzzy set C as the result
% 	of applying OPERATOR on fuzzy sets A and B of universe X. A, B, and X
% 	should be vectors of the same dimension. OPERATOR should be one of the
% 	following strings: 'sum', 'sub', 'prod', and 'div'. The returned fuzzy
% 	set C is a column vector with the same length as A and B. Note that
% 	This function uses interval arithmetics and it assumes
% 	1. A and B are convex fuzzy sets;
% 	2. Membership grades of A and B outside of X are zero.
% 
% 	Fuzzy addition could generates "divide by zero" message, but it will
% 	not affect the correctness of this function. (However, this may cause
% 	problems on machines without IEEE arithmetic, such as VAX and Cray.)
% 
% 	For example:
% 
% 	point_n = 101;			% this determines MF's resolution
% 	min_x = -20; max_x = 20;	% universe is [min_x, max_x]
% 	x = linspace(min_x, max_x, point_n)';
% 	A = trapmf(x, [-10 -2 1 3]);	% trapezoidal fuzzy set A
% 	B = gaussmf(x, [2 5]);		% Gaussian fuzzy set B
% 	C1 = fuzarith(x, A, B, 'sum');
% 	subplot(2,2,1);
% 	plot(x, A, 'y--', x, B, 'm:', x, C1, 'c');
% 	title('fuzzy addition A+B');
% 	C2 = fuzarith(x, A, B, 'sub');
% 	subplot(2,2,2);
% 	plot(x, A, 'y--', x, B, 'm:', x, C2, 'c');
% 	title('fuzzy subtraction A-B');
% 	C3 = fuzarith(x, A, B, 'prod');
% 	subplot(2,2,3);
% 	plot(x, A, 'y--', x, B, 'm:', x, C3, 'c');
% 	title('fuzzy multiplication A*B');
% 	C4 = fuzarith(x, A, B, 'div');
% 	subplot(2,2,4);
% 	plot(x, A, 'y--', x, B, 'm:', x, C4, 'c');
% 	title('fuzzy division A/B');

function findrow
%MATLAB Tour Partial Function Help:  fuz_con
%
% FINDROW Find the rows of a matrix that match the input string.
%    ROWNUM = FINDROW(STR,STRMAT) returns the index to the row or rows
%    in the matrix STRMAT that are identical to the vector STR.
%    Blanks (ASCII 32) and zeros are not considered. An empty matrix 
%    is returned if there is no match.
% 
%    For example:
% 
%    strMat = fstrvcat('one','fish','two','fish',[1 2 3 4 5 6]);
%    rowNum = findrow('fish',strMat)

function genparam
%MATLAB Tour Partial Function Help:  fuz_con
%
% GENPARAM Generate initial membership function parameters for ANFIS learning.
%    GENPARAM(DATA,MF_N,MF_TYPE) generates initial input MF parameters
%    from a M-by-N training data matrix DATA, where M is the number of
%    training data pairs and N is the number of inputs plus one.
%    MF_N and MF_TYPE are optional arguments that specify the MF
%    number and MF type of each input, respectively. MF_N should be a
%    vector of length N. If MF_N is a number, then it applies to all inputs.
%    Similarly, MF_TYPE should be a string matrix of N rows. If MF_TYPE is a
%    single string, it applies to all inputs. Default values for MF_N and
%    MF_TYPE are 2 and 'gbellmf', respectively.
% 
%    The centers of the generated MFs are always equally spaced along the
%    domain of an input variable, where the domain is determined as the
%    interval between the min. and max. of the corresponding column in DATA.
% 
%    Restrictions: (1) 'sigmf', 'smf', and 'zmf' MF types are not supported
%    since they are either open-left or open-right. (2) The same MF type
%    is assigned to MFs of the same input variable.
% 
%    For example:
% 
%        NumData = 1000;
%        data = [rand(NumData,1) 10*rand(NumData,1)-5 rand(NumData,1)];
%        NumMf = [3 7];
%        MfType = str2mat('trapmf','gbellmf');
%        MfParams = genparam(data,NumMf,MfType);
%        set(gcf,'Name','genparam','NumberTitle','off');
%        NumInput = size(data, 2) - 1;
%        range = [min(data)' max(data)'];
%        FirstIndex = [0 cumsum(NumMf)];
%        for i = 1:NumInput;
%            subplot(NumInput, 1, i);
%            x = linspace(range(i, 1), range(i, 2), 100);
%            index = FirstIndex(i)+1:FirstIndex(i)+NumMf(i);
%            mf = evalmmf(x, MfParams(index, :), MfType(i,:));
%            plot(x, mf');
%            xlabel(['input ' num2str(i) ' (' MfType(i, :) ')']);
%        end
% 
%    

function probor
%MATLAB Tour Partial Function Help:  fuz_con
%
% PROBOR	Probabilistic OR.
% 	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.
% 
% 	For example:
% 	
% 		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])

function sugmax
%MATLAB Tour Partial Function Help:  fuz_con
%
% SUGMAX Find maximum output range for Sugeno fuzzy system.
%    [maxOut,minOut]=SUGMAX(FIS) returns two vectors maxOut and
%    minOut that correspond to the highest and lowest possible
%    outputs for the Sugeno fuzzy inference system associated with
%    the matrix FIS, given the prescribed limits on the range of the
%    input variables. There are as many elements in maxOut and maxIn
%    as there are outputs.
% 
%    For example:
% 
%            a=newfis('sugtip','sugeno');
%            a=addvar(a,'input','service',[0 10]);
%            a=addmf(a,'input',1,'poor','gaussmf',[1.5 0]);
%            a=addmf(a,'input',1,'excellent','gaussmf',[1.5 10]);
%            a=addvar(a,'input','food',[0 10]);
%            a=addmf(a,'input',2,'rancid','trapmf',[-2 0 1 3]);
%            a=addmf(a,'input',2,'delicious','trapmf',[7 9 10 12]);
%            a=addvar(a,'output','tip',[0 30]);
%            a=addmf(a,'output',1,'cheap','constant',5);
%            a=addmf(a,'output',1,'generous','constant',25);
%            ruleList=[1 1 1 1 2; 2 2 2 1 2 ];
%            a=addrule(a,ruleList);
%            sugmax(a)

function cmfdlg
%MATLAB Tour Partial Function Help:  fuz_con
%
% CMFDLG Create dialog for adding customized membership function.
%    CMFDLG(action,fisMatrix,varType,varIndex) will open a dialog
%    box for fisMatrix using the default MF name "trimf".
%    varType and varIndex indicate exactly which variable you
%    want to add the customized membership functions to.

function cmthdlg
%MATLAB Tour Partial Function Help:  fuz_con
%
% CMTHDLG Create dialog for adding customized inference methods.
%    CMTHDLG(action,fis,methodType) opens a dialog box that 
%    allows you to add your own inference method to a fuzzy 
%    inference system.

function fisgui
%MATLAB Tour Partial Function Help:  fuz_con
%
% FISGUI Handle generic figure management tasks for fuzzy GUI.
%    This functions handles menu creation and the execution of the
%    "File" menu items like "Save", "Save As...", "Close", and so on.

function gfmfdlg
%MATLAB Tour Partial Function Help:  fuz_con
%
% GFMFDLG Create dialog for specifying membership functions.
%    GFMFDLG(action,fis) will open a dialog
%    box for genfis1 using the default MF type 'trimf'.
%    varType and varIndex indicate exactly which variable you
%    want to add membership functions to.

function mfdlg
%MATLAB Tour Partial Function Help:  fuz_con
%
% MFDLG Create dialog for adding membership functions.
%    MFDLG(action,fisMatrix,varType,varIndex) will open a dialog
%    box for fisMatrix using the default MF type 'trimf'.
%    varType and varIndex indicate exactly which variable you
%    want to add membership functions to.

function mfdrag
%MATLAB Tour Partial Function Help:  fuz_con
%
%  MFDRAG Interactive changes of membership functions by clicking and dragging.
%    It is called from mfedit.m where action is 'mf' and lineHndl is the current
%    selected membership function.  MFDRAG allows clicking and dragging of 
%    membership functions to change their shapes. In general, clicking on a 
%    membership function curve translates the whole curve; clicking on square 
%    control points changes the shape.
% 
%        File name: mfdrag.m
% 
%        

function popundo
%MATLAB Tour Partial Function Help:  fuz_con
%
% POPUNDO Pop the last FIS change off the undo stack.
%    POPUNDO(figNumber) pops the old FIS matrix off of the UserData
%    for the Undo uimenu. The function also broadcasts changes in the FIS
%    matrix to all the other related GUI tools.

function pushundo
%MATLAB Tour Partial Function Help:  fuz_con
%
% PUSHUNDO Push the current FIS onto the undo stack.
%    PUSHUNDO(figNumber,newFIS) pushes the old FIS matrix into the UserData
%    for the Undo uimenu. The function also broadcasts changes in the FIS
%    matrix to all the other related GUI tools, since it gets called every
%    time the FIS matrix gets updated.

function savedlg
%MATLAB Tour Partial Function Help:  fuz_con
%
% SAVEDLG Graphical user interface save warning dialog.
%    SAVEDLG(action,figList) builds a figure that warns the user
%    that system data will be lost unless it is saved before the figure
%    closes.

function statmsg
%MATLAB Tour Partial Function Help:  fuz_con
%
% STATMSG Send message to GUI status field.
%    STATMSG(figNumber,msgStr) causes the message contained in msgStr
%    to be passed to the status line (a text uicontrol field with the
%    Tag property set to "status") of the specified figure. 

function updtfis
%MATLAB Tour Partial Function Help:  fuz_con
%
% UPDTFIS Update all fuzzy GUI tools as needed.
%    UPDTFIS(figNumber,FIS,guiList) updates the fuzzy GUI tools
%    specified by the list guiList with the new fuzzy inference
%    system matrix FIS. figNumber is the figure for the current
%    GUI tool making the update request.

function wsdlg
%MATLAB Tour Partial Function Help:  fuz_con
%
% WSDLG Create dialog for loading/saving FIS in workspace.
%    WSDLG(action,varName,dlgOption) creates a dialog box for either
%    saving to or reading from the workspace.
% 
%    The FIS matrix is given the default workspace variable name varName.
%    The last input argument dlgOption defines whether or not you're passing
%    data into the workspace or out of it.

function defuzzdm
%MATLAB Tour Partial Function Help:  fuz_con
%
% DEFUZZDM Defuzzification methods.
%    DEFUZZDM displays five defuzzification methods supported in the
%    Fuzzy Logic Toolbox.
% 
%        

function fcmdemo
%MATLAB Tour Partial Function Help:  fuz_con
%
% FCMDEMO Fuzzy c-means clustering demo (2-D).
%    FCMDEMO displays a GUI window to let you try out various parameters
%    in fuzzy c-means clustering for 2-D data. You can choose the data set
%    and clustering number from the GUI buttons at right, and then click
%    "Start" to start the fuzzy clustering process.
% 
%    Once the clustering is done, you can select one of the clusters by
%    mouse and view the MF surface by clicking the "MF Plot" button.
%    (Note that "MF Plot" is slow because MATLAB is using the command
%    "griddata" to do interpolation among all data points.) To get a
%    better viewing angle, click and drag inside the figure to rotate the
%    MF surface.
% 
%    If you choose to use a customized data set, it must be 2-D data.
%    Moreover, the data set is normalized to within the unit cube
%    [0,1] X [0,1] before being clustered.
% 
%    File name: fcmdemo.m
% 
%    

function fuzdemos
%MATLAB Tour Partial Function Help:  fuz_con
%
%  Fuzzy Logic Toolbox Demos.
% 
%  General demos
%    defuzzdm   - Defuzzification methods.
%    fcmdemo    - Fuzzy c-means clustering demo (2-D).
%    fuzdemos   - List of all Fuzzy Logic Toolbox demos.
%    invkine    - Inverse kinematics system of a robot arm.
%    irisfcm    - Fuzzy c-means clustering demo (4-D).
%    juggler    - Juggling ball system.
%    mfdemo     - Membership functions.
%    mgtsdemo   - Mackey-Glass time series analysis.
%    noisedm    - Active noise cancellation.
%    trips      - Subtractive clustering demo with demographic data.
% 
%  SIMULINK demos
%    shower     - Shower temperature/flow control model (SIMULINK only).
%    slbb       - Ball and beam control (SIMULINK only)
%    slcp       - Inverted pendulum control (SIMULINK only)
%    slcp1      - Inv. pendulum with varying pole length (SIMULINK only)
%    slcpp1     - Double inv. pendulum with varying pole length (SIMULINK only)
%    sltank     - Water level control (SIMULINK only)
%    sltbu      - Truck backer-upper (SIMULINK only)
%
%
%fuzdemos is both a directory and a function.
%
% FUZDEMOS List of all Fuzzy Logic Toolbox demos.
%    The command FUZDEMOS by itself will open a figure window
%    with buttons corresponding to each demo. To see a demo,
%    press a button.
% 
%    Demos include the pole and cart demo, the truck backing demo, 
%    fuzzy c-means clustering, and others.

function invkine
%MATLAB Tour Partial Function Help:  fuz_con
%
% INVKINE Inverse kinematics of a robot arm.
%    INVKINE opens a window for animation of the inverse kinematics 
%    problem of the two-joint robot arm system. The ellipse is the 
%    desired trajectory; you can change the location of the ellipse by
%    clicking mouse inside it and dragging it to another location.
%    The x marks in the background indicate the location of each
%    training data pair.
% 
%    The training of ANFIS for this problem was done off-line.
%    To see how the training data set was collected and how to do
%    the training, see the file traininv.m. To see both the surfaces
%    for forward and backward kinematics, try invsurf.m.
% 
%    File: invkine.m
% 
%    

function irisfcm
%MATLAB Tour Partial Function Help:  fuz_con
%
%  IRISFCM Fuzzy c-means clustering demo (4-D).
%    This is a script illustrating how to use fuzzy c-means routines for
%    IRIS data clustering, with on-line animation.
% 
%    

function juggler
%MATLAB Tour Partial Function Help:  fuz_con
%
% JUGGLER Ball juggling system.
%    JUGGLER opens a window for the animation of the ball juggling
%    system. The small triangle indicates the desired ball position.
%    You can choose either human or fuzzy control to control this
%    system. If it is controlled by human, click the steering arrow
%    at the upper right corner to change the tilted angle of the
%    hitting board. If it is controlled by the fuzzy controller, use
%    the mouse to change the location of the triangle. (If fuzzy 
%    controller is selected, the position of the small triangle will
%    also be updated randomly every 200 steps)
% 
%    File: juggler.m
% 
%    

function mfdemo
%MATLAB Tour Partial Function Help:  fuz_con
%
% MFDEMO Membership functions.
%    MFDEMO displays 11 MF's supported in the Fuzzy Logic Toolbox.
% 
%    

function mgtsdemo
%MATLAB Tour Partial Function Help:  fuz_con
%
%  This is a slideshow file for use with playshow.m and makeshow.m
%  Too see it run, type 'playshow mgtsdemo', 

function noisedm
%MATLAB Tour Partial Function Help:  fuz_con
%
%  This is a slideshow file for use with playshow.m and makeshow.m
%  Too see it run, type 'playshow noisedm', 

function trips
%MATLAB Tour Partial Function Help:  fuz_con
%
%  This is a slideshow file for use with playshow.m and makeshow.m
%  Too see it run, type 'playshow trips', 

function shower
%MATLAB Tour Partial Function Help:  fuz_con
%
%shower is a Simulink model

function slbb
%MATLAB Tour Partial Function Help:  fuz_con
%
%slbb is a Simulink model

function slcp
%MATLAB Tour Partial Function Help:  fuz_con
%
%slcp is a Simulink model

function slcp1
%MATLAB Tour Partial Function Help:  fuz_con
%
%slcp1 is a Simulink model

function slcpp1
%MATLAB Tour Partial Function Help:  fuz_con
%
%slcpp1 is a Simulink model

function sltank
%MATLAB Tour Partial Function Help:  fuz_con
%
%sltank is a Simulink model

function sltbu
%MATLAB Tour Partial Function Help:  fuz_con
%
%sltbu is a Simulink model

