当前位置:   article > 正文

【SNN脉冲神经网络】SNN脉冲神经网络的工作原理演示MATLAB仿真带GUI界面_snn仿真matlab

snn仿真matlab

  1. clc;clear all;close all;
  2. % 初始参数
  3. I = 10;
  4. sigma = 0.04;beta = 5;gamma = 140;
  5. a = 0.02;b = 0.2;
  6. c = -65;d = 2;
  7. % 步长,改进欧拉法的相关参数
  8. step = 0.1;
  9. timeConter = 0:step:1000;
  10. v = zeros(1,length(timeConter));
  11. u = zeros(1,length(timeConter));
  12. v(1) = -65;%v(2) = -60;
  13. u(1) = 1;%u(1) = 1;
  14. for i_conter = 2:length(timeConter)
  15. K1_1 = sigma*v(i_conter-1)^2+beta*v(i_conter-1)+gamma-u(i_conter-1)+I;
  16. vpn = v(i_conter-1)+step*(sigma*v(i_conter)^2+beta*v(i_conter)+gamma-u(i_conter)+I);
  17. K2_1 = sigma*vpn^2+beta*vpn+gamma-u(i_conter)+I;
  18. v(i_conter) = v(i_conter-1)+step/2*(K1_1+K2_1);
  19. % K1_1 = sigma*v(i_conter-1)^2+beta*v(i_conter-1)+gamma+I;
  20. % vpn = v(i_conter-1)+step*(sigma*v(i_conter)^2+beta*v(i_conter)+gamma+I);
  21. % K2_1 = sigma*vpn^2+beta*vpn+gamma+I;
  22. % v(i_conter) = v(i_conter-1)+step/2*(K1_1+K2_1);
  23. K2_1 = a*(b*v(i_conter-1)-u(i_conter-1));
  24. upn = u(i_conter-1)+step*(a*(b*v(i_conter)-u(i_conter)));
  25. K2_2 = a*(b*v(i_conter)-upn);
  26. u(i_conter) = u(i_conter-1)+step/2*(K2_1+K2_2);
  27. if(v(i_conter)>30)
  28. v(i_conter) = c;
  29. u(i_conter) = u(i_conter)+d;
  30. end
  31. end
  32. plot(timeConter,v)
  33. % figure(2)
  34. % plot(timeConter,u)

D210

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/647563
推荐阅读
相关标签
  

闽ICP备14008679号