gusucode.com > 《MATLAB神经网络超级学习手册》随书光盘源码程序 > code/5/N5_5.m

    P=[0 0.5 1.1 21;0 0.7 1.3 70];
T=[0 1 0 1];	
% net=newp(minmax(P),1);
net=newp(minmax(P),1,'hardlim','learnpn');
net.trainParam.epochs=500;
net=train(net,P,T);
figure;
plotpv(P,T);
plotpc(net.iw{1},net.b{1});
axis([-2 2 -2 2])