为何我用神经网络预测数据,一直提示我Input data sizes do not match net.inputs​{1}.size.错​误,求哪位大神可以帮​我解惑,刚学matl​ab不大懂.

P=[0.00019 -0.00017 0.00028 0.00035 0.00110;
-0.00036 0.00009 0.00016 0.00091 0.00030;
0.00045 0.00052 0.00127 0.00066 0.00112;
0.00007 0.00082 0.00021 0.00067 0.00095;
0.00075 0.00014 0.00060 0.00088 0.00035;];
T=[0];
[p1,minp,maxp,t1,mint,maxt]=premnmx(P,T);
%创建网络
net=newff(minmax(P),[5,1],{'tansig','purelin'},'trainlm');
%设置训练次数
net.trainParam.epochs = 5000;
%设置收敛误差
net.trainParam.goal=0.000001;
%训练网络
[net,tr]=train(net,p1,t1);
%输入数据
a=[-0.00019,0.00036,-0.00045,-0.00007,-0.00075];
%将输入数据归一化
a=premnmx(a);
%放入到网络输出数据
b=sim(net,a);
%将得到的数据反归一化得到预测数据
c=postmnmx(b,mint,maxt);
c

Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Asked:

on 12 Jan 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!