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

【SNN脉冲神经网络】SNN脉冲神经网络的工作原理演示MATLAB仿真带GUI界面_第1张图片

clc;clear all;close all;
% 初始参数

I = 10;
sigma = 0.04;beta = 5;gamma = 140;
a = 0.02;b = 0.2;
c = -65;d = 2;
% 步长,改进欧拉法的相关参数
step = 0.1;
timeConter = 0:step:1000;
v = zeros(1,length(timeConter));
u = zeros(1,length(timeConter));
v(1) = -65;%v(2) = -60;
u(1) = 1;%u(1) = 1;

for i_conter = 2:length(timeConter)
    K1_1 = sigma*v(i_conter-1)^2+beta*v(i_conter-1)+gamma-u(i_conter-1)+I;
     = v(i_conter-1)+step*(sigma*v(i_conter)^2+beta*v(i_conter)+gamma-u(i_conter)+I);
    K2_1 = sigma*^2+beta*+gamma-u(i_conter)+I;
    v(i_conter) = v(i_conter-1)+step/2*(K1_1+K2_1);

%     K1_1 = sigma*v(i_conter-1)^2+beta*v(i_conter-1)+gamma+I;
%      = v(i_conter-1)+step*(sigma*v(i_conter)^2+beta*v(i_conter)+gamma+I);
%     K2_1 = sigma*^2+beta*+gamma+I;
%     v(i_conter) = v(i_conter-1)+step/2*(K1_1+K2_1);
    
    K2_1 = a*(b*v(i_conter-1)-u(i_conter-1));
    upn = u(i_conter-1)+step*(a*(b*v(i_conter)-u(i_conter)));
    K2_2 = a*(b*v(i_conter)-upn);
    u(i_conter) = u(i_conter-1)+step/2*(K2_1+K2_2);
    
    if(v(i_conter)>30)
        v(i_conter) = c;
         u(i_conter) = u(i_conter)+d;
    end
end

plot(timeConter,v)
% figure(2)
% plot(timeConter,u)

D210

你可能感兴趣的:(MATLAB,SNN脉冲神经网络)