A few days ago, I was experimenting with the Neural Network Toolbox in MATLAB and suddenly felt like I was "squatting in the well"—like I had hit a wall. It wasn't that the toolbox was difficult to use, but the data structure required for neural networks is a bit unusual. If you're not careful, it can easily lead to errors. Below, I’ve outlined the correct way to use the toolbox, which might be helpful for others.
Here’s a method that uses batch commands to call the Neural Network Toolbox:
```matlab
P = [0.1515 0.1501 0.1509 0.1504 0.1504 0.1500
0.1515 0.1501 0.1509 0.1504 0.1504 0.1500
0.1515 0.1501 0.1500 0.1504 0.1504 0.1500
0.1515 0.1500 0.1509 0.1504 0.1504 0.1500
0.1515 0.1500 0.1509 0.1504 0.1504 0.1500
0.1515 0.1500 0.1509 0.1504 0.1504 0.1500
0.9684 0.2792 0.877 0.7426 0.7228 0.2272
0.9838 0.2941 0.9181 0.7977 0.7702 0.2452
0.9922 0.3101 0.9475 0.8445 0.8227 0.2665
0.9953 0.3058 0.9625 0.8708 0.8637 0.2624
0.9982 0.3242 0.9797 0.9089 0.9001 0.3008
0.9995 0.3469 0.9917 0.9314 0.9282 0.3678
0.9998 0.3565 0.9948 0.9493 0.9525 0.4500];
T = [0.1521
0.6949
0.7064
0.7083
0.7560
0.7807
0.8182
0.8533
0.8677
0.8459
0.8910
0.9269
0.9496];
P = P'; T = T';
ff = newff(P, T, 13);
ff.trainParam.epochs = 15000;
ff = train(ff, P, T);
Y1 = sim(ff, P);
cf = newcf(P, T, 13);
cf.trainParam.epochs = 15000;
cf = train(cf, P, T);
Y2 = sim(cf, P);
plot(P, T, 'o-');
hold on;
plot(P, Y1, '^m-');
plot(P, Y2, '*-k');
title('newff & newcf');
legend('original data', 'newff result', 'newcf result', 0);
```
One important thing to note here is that `P` and `T` must be transposed first. In MATLAB, each column of the matrix represents a training sample.
After installing MATLAB (which I won’t go into too much detail here), open the command window and type `anfisedit`. This will open the Fuzzy Inference System (FIS) editor. Here's what the interface looks like:

Click the "Load Data" button in the first red box to import your data. You can either load from a file or from the workspace. The data format should be such that the first part contains the system inputs and the latter part contains the system outputs. For example, if your system has 3 inputs and 1 output, the data should look like: `[x1, x2, x3, y]`.
Once you've imported the training data (make sure to select "Training" in the first red box), the toolbox will display the data accordingly. After importing, the interface will update as shown below:

Next, click on "FIS Properties" under the "Edit" menu to adjust the settings. This will bring up a new window where you can configure the fuzzy system parameters, such as the number of membership functions, input/output ranges, and more.
This is just a basic introduction to using the Fuzzy Neural Network Toolbox in MATLAB. There's a lot more you can do, including tuning the system, optimizing the rules, and exporting the FIS for use in other applications.
Plant Protection Drone Battery
Plant Protection Drone Battery,Drone Pro Battery Pack,High Performance Drone Battery,Drone Battery Care
Shenzhen Jentc Technology Co., LTD , https://www.phenyee.com