7643 发表于 2010-7-10 10:54:31

求助,帮忙看下程序 哪里有错误

p=;
t=;
=prestd(p);
=prestd(t);
itr=1:8;itst=8:10;
vt.p=pn(:,itst);vt.t=tn(:,itst);
ptr=pn(:,itr);ttr=tn(:,itr);
net=newff(minmax(ptr),,{'tansug','purelin'});
net=init(net);
net.trainparam.epochs=20000;
net.trainparam.goal=0.01;
=train(net,ptr,ttr);
figure;
A=sim(net,ptr);
=postreg(ttr,A);
a=sim(net,vt.p);
an=poststd(a,meant,stdt);
bn=poststd(vt.t,meant,stdt);
d=(an-bn)./bn;
err=sqrt(sum((an-bn).*(an-bn))/3);

一直提示
??? Index exceeds matrix dimensions.

lengyunfeng 发表于 2010-7-10 14:41:09

1# 7643

你的矩阵索引值超出了矩阵在该维度上的length,例如你=prestd(p);语句生成的pn的size是10*4,而你在vt.p=pn(:,itst);中的itst又用来对第二维进行索引,这三个数均大于4,肯定要报错的。其它错误自己再查查吧
页: [1]
查看完整版本: 求助,帮忙看下程序 哪里有错误