Advertisement
desdemona

kraina tęczy

Apr 15th, 2013
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.29 KB | None | 0 0
  1. X=[1 1; 2 2; 2 1; 1 2];
  2. Y =[1; 1; 0; 0];
  3. net = newff([0 3; 0 3], [2 1], {'tansig' 'purelin'}, 'trainlm');
  4. net =init(net);
  5. net.trainParam.epochs = 200;
  6. net.trainParam.goal=0.0000001;
  7. net=train(net, X', Y');
  8. [X1 Y1] = meshgrid(0:0.1:3);
  9. Z=X1;
  10. Z(:)=sim(net,[X1(:)'; Y1(:)']);
  11. surf(X1, Y1, Z);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement