精选优质文档-倾情为你奉上function main()SamNum=100;%训练样本数TestSamNum=101;%测试样本数HiddenUnitNum=10;%隐节点数InDim=1;%输入样本维数OutDim=1;%输出维数%下面是一个函数rand(state,sum(100*clock)NoiseVar=0.1;Noise=NoiseVar*randn(1,SamNum);SamIn=8*rand(1,SamNum)-4;SamOutNoNoise=1.1*(1-SamIn+2*SamIn.2).*exp(-SamIn.2/2);SamOut=SamOutNoNoise+Noise;TestSamIn=-4:0.08:4;TestSamOut=1.1*(1-TestSamIn+2*TestSamIn.2).*exp(-TestSamIn.2/2);figurehold ongridplot(SamIn,SamOut,k*)figureplot(TestSam