p=0:0.05:pi*0.5;t=sin(p);net=newff(minmax(p),[10,1],{'tansig','purelin'},'trainlm');y1=sim(net,p);net.trainParam.epochs=1000;net.trainParam.lr=0.05;net.trainParam.goal=1e-5;[net,tr]=train(net,p,t);y2=sim(net,p);plot(p,t,'-o',p,y2,'--');