Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X=[1 1; 2 2; 2 1; 1 2];
- Y =[1; 1; 0; 0];
- net = newff([0 3; 0 3], [2 1], {'tansig' 'purelin'}, 'trainlm');
- net =init(net);
- net.trainParam.epochs = 200;
- net.trainParam.goal=0.0000001;
- net=train(net, X', Y');
- [X1 Y1] = meshgrid(0:0.1:3);
- Z=X1;
- Z(:)=sim(net,[X1(:)'; Y1(:)']);
- surf(X1, Y1, Z);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement