clear all; x=[0 1 2 3 4 5 6 7 8]; t=[0 0.84 0.91 0.14 -0.77 -0.96 -0.28 0.66 0.99]; plot(x,t,'o'); net=feedforwardnet(10); %创建两层前反馈网络,有10元 net=configure(net,x,t); y1=net(x) plot(x,t,'o',x,y1,'x'); %%此时的y1: = -1.8260 -0.1460 1.5486 2.1347 3.5209 4.6727 4.3351 3.4458 4.0257 net=train(net,x,t); %对网络进行训练 y2=net(x); plot(x,t,'o',x,y1,'x',x,y2,'*'); %%此时的y2: -0.5608 0.8365 -0.3636 0.1337 -0.7477 -0.9427 -0.3031 0.6589 0.9676