请帮忙看下我的程序哪里错了,谢谢!
我想做一个神经网络预测,在matlab下建模,代码如下:p=[327.15 15390; 369.16 19.09;423.98 20.54;497.35 22.93;590.17 30.18;
721.94 35.08;878.41 41.83;1073.76 48.76;1334.20 62.48]';
t=';
for i=1:2
P(i,:)=(p(i,:)-min(p(i,:)))/(max(p(i,:))-min(p(i,:)));
end
for i=1:1
T(i,:)=(t(i,:)-min(t(i,:)))/(max(t(i,:))-min(t(i,:)));
end
threshold=;
net=newff(threshold,,{'tansig','logsig'},'trainlm');
net.trainParam.epochs=100;
net.trainParam.goal=0.001;
LP.lr=0.1;
net=train(net,P,T);
P_test=;
Out=sim(net,P_test);
X=;
plot(1:9,X-Out)
报错:??? Error using ==> minus
Matrix dimensions must agree.
请教下错在哪里,谢谢 X is 1*10, Out is 1*9
X-Out ??? 下面的代码是否应修改一下?
p(i,:)和min(p(i,:))的维数不同,是不是不能进行减法操作?
for i=1:2
P(i,:)=(p(i,:)-min(p(i,:)))/(max(p(i,:))-min(p(i,:)));
end
for i=1:1
T(i,:)=(t(i,:)-min(t(i,:)))/(max(t(i,:))-min(t(i,:)));
end
十分感谢楼上二位的解答,谢谢!
页:
[1]