thumbzoe 发表于 2009-5-6 21:59

BP急

p=[0 452.489 118 3.3344 12.7861;
   5.43 2920.658 741 4.0021 15.7743;
   7.68 5546.767 1312 3.5051 14.8186;
   11.46 5461.617 1384 3.7118 14.6477;
   3.19 5523.835 1365 3.9657 16.0481;
   1.33 2948.432 854 3.0113 10.3965;
   1.44 2665.319 515 2.876 14.8846;
   0.51 2047.274 672 4.522 13.7764;
   10.56 5869.804 947 2.8862 17.8896;
   2.36 4514.143 1266 3.501 12.4835;
   46.2 7494.088 1879 3.235 12.9022;
   7.52 8099.29 2061 3.6617 14.3897;
   2.92 10216.07 2593 2.9896 11.7787;
   10.38 10500.55 2996 3.1268 10.9588;
   7.97 1833.322 785 2.9144 6.8063];
for i=1:5
P(i,:)=(p(i,:)-min(p(i,:)))/(max(p(i,:))-min(p(i,:)));
end
t=;
for i=1:1
T(i,:)=(t(i,:)-min(t(i,:)))/(max(t(i,:))-min(t(i,:)));
end
net=newff(minmax(P),,{'tansig','purelin'},'trainlm');
net.trainParam.epochs=500;
net.trainParam.goal=1e-7;
net.trainParam.Ir=0.0001;
=train(net,P,T);
a=sim(net,P)
请问这个程序到底怎么错了?
怎么解决这两个问题?
Warning: Divide by zero.
(Type "warning off MATLAB:divideByZero" to suppress this warning.)
??? Error using ==> network/train
Targets are incorrectly sized for network.
Matrix must have 1 rows.

ChaChing 发表于 2009-5-6 22:17

回复 楼主 thumbzoe 的帖子

t为15*1, 当i=1
max(t(i,:))=max(t(1,1))=t(1,1), min(t(i,:))=min(t(1,1))=t(1,1), 分母为零!
BP不懂, t为15*1, 还是1*15? 或则应该用max(t(:,i))?
页: [1]
查看完整版本: BP急