Matlab: how to define fismat

  • MATLAB
  • Thread starter sensitive
  • Start date
  • Tags
    Matlab
In summary, the conversation is about using the genfis1 and anfis commands in MATLAB for cross validation. The speaker is having trouble defining the fismat required for the anfis command and is seeking help in resolving the issue. They also provide an example of how to specify parameters for the genfis1 command.
  • #1
sensitive
35
0
I am working on a MATLAB code for cross validation.

I have define the test and training set but I am having trouble using the anfis command. Before carrying out the training using anfis command I need to define the fismat. How do i define fismat?

My code is as follows:

load visit1.mat
V1 = visit1;
chkData = V1(1,1);
trnData = V1(2:20,:);
fismat = genfis1(trnData)
[fismat1,trnError,ss,fismat2,chkError] = anfis(trnData,fismat,trnOpt,dispOpt,chkData);

I am trouble on linr 5, it gives me error saying non-existent field 'input'.

I appreciate any help I can get. Thank you...
 
Physics news on Phys.org
  • #2
The genfis1 command is used to generate a fuzzy inference system (FIS) structure. You can define the parameters of the FIS, such as the number of input and output variables, the type of membership function to use, and the rule base structure, by passing in additional arguments to the genfis1 command.

For example, if you want to specify two inputs, one output, and a grid partitioning of each input variable, you would use the following command:

fismat = genfis1(trnData, 2, 1, [4 4]);

The first argument is the training data, the second is the number of inputs, the third is the number of outputs, and the fourth is a vector specifying the number of partitions for each input variable.

You can also specify other parameters, such as the membership function type and the rule base structure, using additional arguments. For more information, please refer to the MATLAB documentation on the genfis1 command.
 
  • #3


To define a fismat in MATLAB, you can use the "genfis1" command, as you have done in your code. However, it seems like there may be an error in your code as the "input" field is not recognized. This could be due to a few reasons, such as a typo or incorrect formatting of your data. I would recommend double-checking your code and data to ensure they are correct. Additionally, you can refer to the MATLAB documentation or seek help from other MATLAB users or forums for further assistance.
 

1. What is a fismat in Matlab?

A fismat in Matlab is a data structure used for representing fuzzy inference systems. It contains all the necessary information about the system, such as the input and output variables, membership functions, and rule base.

2. How do I define a fismat in Matlab?

To define a fismat in Matlab, you can use the fismat function. The syntax is as follows:

fismatObj = fismat(numInputs, numOutputs, numMFs)

Where numInputs is the number of input variables, numOutputs is the number of output variables, and numMFs is the number of membership functions for each variable.

3. What is the purpose of defining a fismat in Matlab?

The main purpose of defining a fismat in Matlab is to create a structure that can be used for fuzzy inference. By defining the membership functions, input and output variables, and rule base, you can perform fuzzy logic operations on your data.

4. Can I modify a defined fismat in Matlab?

Yes, you can modify a defined fismat in Matlab by using the various functions available for fismats, such as addInput, addOutput, and addRule. These functions allow you to add or remove variables, membership functions, and rules from the fismat.

5. Are there any built-in fismats in Matlab?

Yes, there are several built-in fismats in Matlab, such as anfis (Adaptive Neuro-Fuzzy Inference System), mamdani (Mamdani-type fuzzy inference system), and sugeno (Sugeno-type fuzzy inference system). These fismats can be used directly or modified to suit your specific needs.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Back
Top