Advertisement
Nikitka_36

НС

Mar 12th, 2015
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.34 KB | None | 0 0
  1. x = linspace(-10, 10);
  2. y = x.^3 - 8*x.^2;
  3.  
  4. pNS = linspace(-10, 10, 200);
  5. tNS = pNS.^3 - 8*pNS.^2;
  6.  
  7. net1 = newff(pNS, tNS, 6, {'tansig' 'purelin'});
  8. net1.trainParam.epochs = 500;
  9. net1 = train(net1, pNS, tNS);
  10.  
  11. y1 = sim(net1, pNS);
  12. plot(pNS, y1,'o', pNS, tNS, '+')
  13. grid on;
  14.  
  15. e = abs(y1 - tNS);
  16. plot(e)
  17. figure;
  18.  
  19.  
  20. %plot(x, y, 's')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement