Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clc;
- clear;
- warning('off', 'all');
- FontSize = 16;
- path1 = '/Users/sergeymakovkin/Documents/Fig_02_N_A_bifurc/n_step_0005';
- filename1 = 'Data_SF_I_stim_V_max_V_min_nu.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- I_stim_SF = Data(:, 1);
- V_max_SF = Data(:, 2);
- V_min_SF = Data(:, 3);
- nu_n_SF = Data(:, 4);
- disp('Data_SF_I_stim_V_max_V_min_nu load complete');
- filename1 = 'Data_LC_I_stim_V_max_V_min_nu.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- I_stim_LC = Data(:, 1);
- V_max_LC = Data(:, 2);
- V_min_LC = Data(:, 3);
- nu_n_LC = Data(:, 4);
- disp('Data_LC_I_stim_V_max_V_min_nu load complete');
- path2 = '/Users/sergeymakovkin/Documents/Fig_02_N_A_bifurc/n_step_0005_back';
- filename2 = 'Data_LC_I_stim_V_max_V_min_nu_back.txt';
- Data_back = importdata( [ path2 '/' filename2 ] );
- I_stim_back = Data_back(:, 1);
- V_max_back = Data_back(:, 2);
- V_min_back = Data_back(:, 3);
- nu_n_back = Data_back(:, 4);
- disp('Data_I_stim_V_max_V_min_back load complete');
- path3 = '/Users/sergeymakovkin/Documents/Fig_02_N_A_bifurc/a_step_0005';
- filename3 = 'Data_SF_1_v_4_Ca_max_Ca_min_nu.txt';
- Data = importdata( [ path3 '/' filename3 ] );
- v_4_SF_1 = Data(:, 1);
- Ca_max_SF_1 = Data(:, 2);
- Ca_min_SF_1 = Data(:, 3);
- nu_a_SF_1 = Data(:, 4);
- disp('Data_SF_1_v_4_Ca_max_Ca_min_nu load complete');
- path4 = '/Users/sergeymakovkin/Documents/Fig_02_N_A_bifurc/a_step_0005';
- filename4 = 'Data_LC_1_v_4_Ca_max_Ca_min_nu.txt';
- Data = importdata( [ path4 '/' filename4 ] );
- v_4_LC_1 = Data(:, 1);
- Ca_max_LC_1 = Data(:, 2);
- Ca_min_LC_1 = Data(:, 3);
- nu_a_LC_1 = Data(:, 4);
- disp('Data_LC_1_v_4_Ca_max_Ca_min_nu load complete');
- path5 = '/Users/sergeymakovkin/Documents/Fig_02_N_A_bifurc/a_step_0005_back';
- filename5 = 'Data_SF_2_v_4_Ca_max_Ca_min_nu_back.txt';
- Data_back = importdata( [ path5 '/' filename5 ] );
- v_4_back_SF_2 = Data_back(:, 1);
- Ca_max_back_SF_2 = Data_back(:, 2);
- Ca_min_back_SF_2 = Data_back(:, 3);
- nu_a_back_SF_2 = Data_back(:, 4);
- disp('Data_SF_2_v_4_Ca_max_Ca_min_back load complete');
- path6 = '/Users/sergeymakovkin/Documents/Fig_02_N_A_bifurc/a_step_0005_back';
- filename6 = 'Data_LC_2_v_4_Ca_max_Ca_min_nu_back.txt';
- Data_back = importdata( [ path6 '/' filename6 ] );
- v_4_back_LC_2 = Data_back(:, 1);
- Ca_max_back_LC_2 = Data_back(:, 2);
- Ca_min_back_LC_2 = Data_back(:, 3);
- nu_a_back_LC_2 = Data_back(:, 4);
- disp('Data_LC_2_v_4_Ca_max_Ca_min_back load complete');
- results_neuro_astro_bifurc = figure('units', 'normalized', 'outerposition', [0 0 0.8 1], 'visible', 'on');
- sp221 = subplot(2, 2, 1);
- plot(I_stim_SF, V_max_SF, 'g-', 'LineWidth', 2);
- hold on;
- plot(I_stim_SF, V_min_SF, 'g-', 'LineWidth', 2);
- hold on;
- plot(I_stim_LC, V_max_LC, 'r-', 'LineWidth', 2);
- hold on;
- plot(I_stim_LC, V_min_LC, 'r-', 'LineWidth', 2);
- hold on;
- plot(I_stim_back, V_max_back, 'b-', 'LineWidth', 2);
- hold on;
- plot(I_stim_back, V_min_back, 'b-', 'LineWidth', 2);
- hold on;
- %grid on;
- box on;
- %pbaspect([1 1 1]);
- xlim([0 2.0]);
- ylim([-80 20]);
- ax = gca;
- ax.XTick = [0: 0.5: 2.0];
- xtickformat('%1.1f');
- ax.YTick = [-80: 20: 20];
- ytickformat('%.0f');
- %yticklabels({'0', '\pi/2', '\pi', '3\pi/2', '2\pi'});
- %yticklabels({'0', '\pi/4', '\pi/2', '3\pi/4', '\pi', '5\pi/4', '3\pi/2', '7\pi/4', '2\pi'});
- %legend('<\nu_i>');
- %xlabel('I_{stim}, \muA/cm^{2}', 'FontSize', FontSize);
- ylabel('V, mV', 'FontSize', FontSize);
- title('a)', 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- sp223 = subplot(2, 2, 3);
- plot(I_stim_SF, nu_n_SF, 'g-', 'LineWidth', 2);
- hold on;
- plot(I_stim_LC, nu_n_LC, 'r-', 'LineWidth', 2);
- hold on;
- plot(I_stim_back, nu_n_back, 'b-', 'LineWidth', 2);
- hold on;
- x_start_1 = 1.08;
- x_end_1 = 1.08;
- y_start_1 = 7;
- y_end_1 = 16;
- RedArrow = annotation('arrow');
- RedArrow.Parent = gca;
- RedArrow.X = [x_start_1, x_end_1];
- RedArrow.Y = [y_start_1, y_end_1];
- RedArrow.Color = 'red';
- hold on;
- x_start_2 = 0.78;
- x_end_2 = 0.78;
- y_start_2 = 11.5;
- y_end_2 = 2.5;
- BlueArrow = annotation('arrow');
- BlueArrow.Parent = gca;
- BlueArrow.X = [x_start_2, x_end_2];
- BlueArrow.Y = [y_start_2, y_end_2];
- BlueArrow.Color = 'blue';
- hold on;
- %grid on;
- box on;
- xlim([0 2.0]);
- ylim([0 40]);
- ax = gca;
- ax.XTick = [0: 0.5: 2.0];
- xtickformat('%.1f');
- ax.YTick = [0: 10: 40];
- ytickformat('%.0f');
- %yticklabels({'0', '\pi/2', '\pi', '3\pi/2', '2\pi'});
- %yticklabels({'0', '\pi/4', '\pi/2', '3\pi/4', '\pi', '5\pi/4', '3\pi/2', '7\pi/4', '2\pi'});
- %legend('<\nu_i>');
- xlabel('I_{stim}, \muA/cm^{2}', 'FontSize', FontSize);
- ylabel('\nu, s^{-1}', 'FontSize', FontSize);
- title('b)', 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- sp222 = subplot(2, 2, 2);
- plot(v_4_SF_1, Ca_max_SF_1, 'g-', 'LineWidth', 2);
- hold on;
- plot(v_4_SF_1, Ca_min_SF_1, 'g-', 'LineWidth', 2);
- hold on;
- plot(v_4_back_SF_2, Ca_max_back_SF_2, 'g-', 'LineWidth', 2);
- hold on;
- plot(v_4_back_SF_2, Ca_min_back_SF_2, 'g-', 'LineWidth', 2);
- hold on;
- plot(v_4_LC_1, Ca_max_LC_1, 'r-', 'LineWidth', 2);
- hold on;
- plot(v_4_LC_1, Ca_min_LC_1, 'r-', 'LineWidth', 2);
- hold on;
- plot(v_4_back_LC_2, Ca_max_back_LC_2, 'b-', 'LineWidth', 2);
- hold on;
- plot(v_4_back_LC_2, Ca_min_back_LC_2, 'b-', 'LineWidth', 2);
- hold on;
- %grid on;
- box on;
- xlim([0 2.5]);
- ylim([0 0.7]);
- ax = gca;
- ax.XTick = [0: 0.5: 2.5];
- xtickformat('%.1f');
- ax.YTick = [0: 0.1: 0.7];
- ytickformat('%.1f');
- %yticklabels({'0', '\pi/2', '\pi', '3\pi/2', '2\pi'});
- %yticklabels({'0', '\pi/4', '\pi/2', '3\pi/4', '\pi', '5\pi/4', '3\pi/2', '7\pi/4', '2\pi'});
- %legend('<\nu_i>');
- %xlabel('v_{4}, \muM/s', 'FontSize', FontSize);
- ylabel('[Ca^{2+}], \muM', 'FontSize', FontSize);
- title('c)', 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- sp224 = subplot(2, 2, 4);
- plot(v_4_SF_1, nu_a_SF_1, 'g-', 'LineWidth', 2);
- hold on;
- plot(v_4_back_SF_2, nu_a_back_SF_2, 'g-', 'LineWidth', 2);
- hold on;
- plot(v_4_LC_1, nu_a_LC_1, 'r-', 'LineWidth', 2);
- hold on;
- plot(v_4_back_LC_2, nu_a_back_LC_2, 'b-', 'LineWidth', 2);
- hold on;
- x_start_12 = 2.13;
- x_end_12 = 2.13;
- y_start_12 = 0.08;
- y_end_12 = 0.02;
- RedArrow2 = annotation('arrow');
- RedArrow2.Parent = gca;
- RedArrow2.X = [x_start_12, x_end_12];
- RedArrow2.Y = [y_start_12, y_end_12];
- RedArrow2.Color = 'red';
- hold on;
- x_start_22 = 1.73;
- x_end_22 = 1.73;
- y_start_22 = 0.02;
- y_end_22 = 0.08;
- BlueArrow2 = annotation('arrow');
- BlueArrow2.Parent = gca;
- BlueArrow2.X = [x_start_22, x_end_22];
- BlueArrow2.Y = [y_start_22, y_end_22];
- BlueArrow2.Color = 'blue';
- %grid on;
- box on;
- xlim([0 2.5]);
- ylim([0 0.15]);
- ax = gca;
- ax.XTick = [0: 0.5: 2.5];
- xtickformat('%.1f');
- ax.YTick = [0: 0.025: 0.15];
- ytickformat('%.3f');
- %yticklabels({'0', '\pi/2', '\pi', '3\pi/2', '2\pi'});
- %yticklabels({'0', '\pi/4', '\pi/2', '3\pi/4', '\pi', '5\pi/4', '3\pi/2', '7\pi/4', '2\pi'});
- %legend('<\nu_i>');
- xlabel('v_4, \muM/s', 'FontSize', FontSize);
- ylabel('\nu, s^{-1}', 'FontSize', FontSize);
- title('d)', 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- saveas(gcf, 'results_neuro_astro_bifurc.png');
- saveas(gcf, 'results_neuro_astro_bifurc', 'epsc');
- close(results_neuro_astro_bifurc);
- disp('Picture results_neuro_astro_bifurc save');
- return
- %{
- path1 = '/home/makovkin_s/HH_Recogn_2023_03_01_4x1_RN_SN_IN_CN_E_syn_IN_phi_CN_RN_steps_500_1';
- %path1 = '/Users/sergeymakovkin/Documents/HH_Recogn_2022_11_21_1x1_4th_Excitation_Phase'; FontSize = 20;
- filename1 = 'Data_E_syn_IN_phi_CN_RN.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- V_syn_IN_1 = Data(:, 1);
- Phase_CN_RN_1 = Data(:, 2);
- disp('Data_E_syn_IN_phi_CN_RN 1 load complete');
- path1 = '/home/makovkin_s/HH_Recogn_2023_03_01_4x1_RN_SN_IN_CN_E_syn_IN_phi_CN_RN_steps_500_2';
- %path1 = '/Users/sergeymakovkin/Documents/HH_Recogn_2022_11_21_1x1_4th_Excitation_Phase'; FontSize = 20;
- filename1 = 'Data_E_syn_IN_phi_CN_RN.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- V_syn_IN_2 = Data(:, 1);
- Phase_CN_RN_2 = Data(:, 2);
- disp('Data_E_syn_IN_phi_CN_RN 2 load complete');
- path1 = '/home/makovkin_s/HH_Recogn_2023_03_01_4x1_RN_SN_IN_CN_E_syn_IN_phi_CN_RN_steps_500_3';
- %path1 = '/Users/sergeymakovkin/Documents/HH_Recogn_2022_11_21_1x1_4th_Excitation_Phase'; FontSize = 20;
- filename1 = 'Data_E_syn_IN_phi_CN_RN.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- V_syn_IN_3 = Data(:, 1);
- Phase_CN_RN_3 = Data(:, 2);
- disp('Data_E_syn_IN_phi_CN_RN 3 load complete');
- path1 = '/home/makovkin_s/HH_Recogn_2023_03_01_4x1_RN_SN_IN_CN_E_syn_IN_phi_CN_RN_steps_500_4';
- %path1 = '/Users/sergeymakovkin/Documents/HH_Recogn_2022_11_21_1x1_4th_Excitation_Phase'; FontSize = 20;
- filename1 = 'Data_E_syn_IN_phi_CN_RN.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- V_syn_IN_4 = Data(:, 1);
- Phase_CN_RN_4 = Data(:, 2);
- disp('Data_E_syn_IN_phi_CN_RN 4 load complete');
- %}
- results_Phase_CN_RN_V_syn_SN = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- %plot(V_syn_IN, Phase_CN_RN, '.', 'LineWidth', 2);
- plot(V_syn_SN, Phase_CN_RN, 'k.', 'MarkerSize', 6);
- hold on;
- %{
- plot(V_syn_IN_1, Phase_CN_RN_1, 'k.', 'MarkerSize', 6);
- hold on;
- plot(V_syn_IN_2, Phase_CN_RN_2, 'k.', 'MarkerSize', 6);
- hold on;
- plot(V_syn_IN_3, Phase_CN_RN_3, 'k.', 'MarkerSize', 6);
- hold on;
- plot(V_syn_IN_4, Phase_CN_RN_4, 'k.', 'MarkerSize', 6);
- hold on;
- %}
- grid on;
- box on;
- %xlim([-73 -69]);
- xlim([-90 0]);
- %ylim([3*pi/2 2*pi]);
- ylim([0 2*pi]);
- ax = gca;
- %ax.XTick = [-80: 1: 65];
- ax.XTick = [-90: 5: 0];
- xtickformat('%.0f');
- %ax.YTick = [0: pi/2: 2*pi];
- ax.YTick = [0: pi/4: 2*pi];
- %ytickformat('%.2f');
- %yticklabels({'0', '\pi/2', '\pi', '3\pi/2', '2\pi'});
- yticklabels({'0', '\pi/4', '\pi/2', '3\pi/4', '\pi', '5\pi/4', '3\pi/2', '7\pi/4', '2\pi'});
- %legend('<\nu_i>');
- xlabel('V_{syn SN eff}, mV', 'FontSize', FontSize);
- ylabel('\Delta\phi_{V_{CN}-V_{RN}}', 'FontSize', FontSize);
- title('\Delta\phi between V_{CN} and V_{RN}', 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- saveas(gcf, 'results_Phase_CN_RN_V_syn_SN.png');
- %saveas(gcf, 'results_Phase_CN_RN_V_syn_SN', 'epsc');
- close(results_Phase_CN_RN_V_syn_SN);
- disp('Picture results_Phase_CN_RN_V_syn_SN save');
- return
- Data_Delta_Phi_CN_RN_E_syn_IN = [phi_new_CN_RN(end), E_syn_IN];
- formatSpec = '%2.4f\t%2.4f\n';
- fileID = fopen('Data_Delta_Phi_CN_RN_E_syn_IN.txt', 'A');
- fprintf(fileID, formatSpec, Data_Delta_Phi_CN_RN_E_syn_IN');
- fclose(fileID);
- return
- %{
- %%%%%%%%%%%%%%
- omega_cur = 0;
- omega_total = [];
- yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 2;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, 'MinPeakHeight', -10);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) ~= 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(time_V(locs));
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- %end
- time_locs_2 = time_V(locs);
- omega_cur_2 = omega_cur;
- state_2 = 0;
- if size(time_locs_2, 1) >= 1
- state_2 = 1;
- else state_2 == 0;
- end
- %}
- Data_I_app_IN_g_syn_SN_freq_IN = [I_app_3, g_syn_2, freq_3];
- formatSpec = '%2.4f\t%2.4f\t%2.4f\n';
- fileID = fopen('Data_I_app_IN_g_syn_SN_freq_IN.txt','A');
- fprintf(fileID, formatSpec, Data_I_app_IN_g_syn_SN_freq_IN');
- fclose(fileID);
- return
- Data_2 = [time_locs_2(2:end), omega_cur_2];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_2.txt','w');
- fprintf(fileID, formatSpec, Data_2');
- fclose(fileID);
- return
- %%%%%%%%%%%%%%%%%%%%%%%% Phases Begin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- omega_cur = 0;
- omega_total = [];
- yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 1;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, 'MinPeakHeight', -10);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) ~= 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(time_V(locs));
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- %end
- time_locs_1 = time_V(locs);
- omega_cur_1 = omega_cur;
- Data_1 = [time_locs_1(2:end), omega_cur_1];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_1.txt','w');
- fprintf(fileID, formatSpec, Data_1');
- fclose(fileID);
- %%%%%%%%%%%%%%%%%
- omega_cur = 0;
- omega_total = [];
- yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 2;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, 'MinPeakHeight', -10);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) ~= 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(time_V(locs));
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- %end
- time_locs_2 = time_V(locs);
- omega_cur_2 = omega_cur;
- Data_2 = [time_locs_2(2:end), omega_cur_2];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_2.txt','w');
- fprintf(fileID, formatSpec, Data_2');
- fclose(fileID);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- omega_cur = 0;
- omega_total = [];
- yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 3;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, 'MinPeakHeight', -10);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) ~= 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(time_V(locs));
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- %end
- time_locs_3 = time_V(locs);
- omega_cur_3 = omega_cur;
- Data_3 = [time_locs_3(2:end), omega_cur_3];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_3.txt','w');
- fprintf(fileID, formatSpec, Data_3');
- fclose(fileID);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- omega_cur = 0;
- omega_total = [];
- yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 4;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, 'MinPeakHeight', -10);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) ~= 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(time_V(locs));
- omega_total = [omega_total omega_cur'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- %end
- time_locs_4 = time_V(locs);
- omega_cur_4 = omega_cur;
- Data_4 = [time_locs_4(2:end), omega_cur_4];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_4.txt','w');
- fprintf(fileID, formatSpec, Data_4');
- fclose(fileID);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- results_freq_phase_phi_1_2 = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(2, 1, 1);
- plot(time_locs_1(2:end), omega_cur_1, '.', 'LineWidth', 2);
- hold on;
- plot(time_locs_2(2:end), omega_cur_2, '.', 'LineWidth', 2);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- legend('\nu_1', '\nu_2');
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, sec^{-1}', 'FontSize', FontSize);
- title('\nu_1, \nu_2', 'FontSize', FontSize);
- min_time_size_RN_SN = min(size(time_locs_1, 1), size(time_locs_2, 1));
- max_per_RN_SN = max(max(diff(time_locs_1)), max(diff(time_locs_2)));
- phi_RN_SN = 2*pi*(time_locs_1(1:min_time_size_RN_SN) - time_locs_2(1:min_time_size_RN_SN)) / max_per_RN_SN;
- phi_1_2_mean = mod(phi_RN_SN, 2*pi);
- phi_1_2_mean = phi_1_2_mean(round(end/2): end, :);
- phi_1_2_mean = mean(phi_1_2_mean);
- Data_Phase_1_2 = [E_syn, phi_1_2_mean];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_Phase_1_2.txt','a');
- fprintf(fileID, formatSpec, Data_Phase_1_2');
- fclose(fileID);
- %figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(2, 1, 2)
- plot(time_locs_2(1:min_time_size_RN_SN), mod(phi_RN_SN, 2*pi), '.', 'LineWidth', 3);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0 2*pi]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- yticks([0, pi/2, pi, 3*pi/2, 2*pi])
- yticklabels({'0','\pi/2','\pi','3/2 \pi','2 \pi'})
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\Delta \phi_{1, 2}, rad', 'FontSize', FontSize);
- title('\Delta \phi_{1, 2}', 'FontSize', FontSize);
- saveas(gcf, 'results_freq_phase_phi_1_2.png');
- %saveas(gcf, 'results_freq_phase_phi_1_2', 'epsc');
- close(results_freq_phase_phi_1_2);
- disp('results_freq_phase_phi_1_2 save');
- results_freq_phase_phi_1_3 = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(2, 1, 1);
- plot(time_locs_1(2:end), omega_cur_1, '.', 'LineWidth', 2);
- hold on;
- plot(time_locs_3(2:end), omega_cur_3, '.', 'LineWidth', 2);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- legend('\nu_1', '\nu_3');
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, sec^{-1}', 'FontSize', FontSize);
- title('\nu_1, \nu_3', 'FontSize', FontSize);
- min_time_size_1_3 = min(size(time_locs_1, 1), size(time_locs_3, 1));
- max_per_1_3 = max(max(diff(time_locs_1)), max(diff(time_locs_3)));
- phi_1_3 = 2*pi*(time_locs_1(1:min_time_size_1_3) - time_locs_3(1:min_time_size_1_3)) / max_per_1_3;
- phi_1_3_mean = mod(phi_1_3, 2*pi);
- phi_1_3_mean = phi_1_3_mean(round(end/2): end, :);
- phi_1_3_mean = mean(phi_1_3_mean);
- Data_Phase_1_3 = [E_syn, phi_1_3_mean];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_Phase_1_3.txt','a');
- fprintf(fileID, formatSpec, Data_Phase_1_3');
- fclose(fileID);
- %figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(2, 1, 2)
- plot(time_locs_3(1:min_time_size_1_3), mod(phi_1_3, 2*pi), '.', 'LineWidth', 3);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0 2*pi]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- yticks([0, pi/2, pi, 3*pi/2, 2*pi])
- yticklabels({'0','\pi/2','\pi','3/2 \pi','2 \pi'})
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\Delta \phi_{1, 3}, rad', 'FontSize', FontSize);
- title('\Delta \phi_{1, 3}', 'FontSize', FontSize);
- saveas(gcf, 'results_freq_phase_phi_1_3.png');
- %saveas(gcf, 'results_freq_phase_phi_1_3', 'epsc');
- close(results_freq_phase_phi_1_3);
- disp('results_freq_phase_phi_1_3 save');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- results_freq_phase_phi_1_4 = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(2, 1, 1);
- plot(time_locs_1(2:end), omega_cur_1, '.', 'LineWidth', 2);
- hold on;
- plot(time_locs_4(2:end), omega_cur_4, '.', 'LineWidth', 2);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- legend('\nu_1', '\nu_4');
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, sec^{-1}', 'FontSize', FontSize);
- title('\nu_1, \nu_4', 'FontSize', FontSize);
- min_time_size_1_4 = min(size(time_locs_1, 1), size(time_locs_4, 1));
- max_per_1_4 = max(max(diff(time_locs_1)), max(diff(time_locs_4)));
- phi_1_4 = 2*pi*(time_locs_1(1:min_time_size_1_4) - time_locs_4(1:min_time_size_1_4)) / max_per_1_4;
- phi_1_4_mean = mod(phi_1_4, 2*pi);
- phi_1_4_mean = phi_1_4_mean(round(end/2): end, :);
- phi_1_4_mean = mean(phi_1_4_mean);
- Data_Phase_1_4 = [E_syn, phi_1_4_mean];
- formatSpec = '%2.4f %2.4f\n';
- fileID = fopen('Data_Phase_1_4.txt','a');
- fprintf(fileID, formatSpec, Data_Phase_1_4');
- fclose(fileID);
- %figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(2, 1, 2)
- plot(time_locs_4(1:min_time_size_1_4), mod(phi_1_4, 2*pi), '.', 'LineWidth', 3);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0 2*pi]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- yticks([0, pi/2, pi, 3*pi/2, 2*pi])
- yticklabels({'0','\pi/2','\pi','3/2 \pi','2 \pi'})
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\Delta \phi_{1, 4}, rad', 'FontSize', FontSize);
- title('\Delta \phi_{1, 4}', 'FontSize', FontSize);
- saveas(gcf, 'results_freq_phase_phi_1_4.png');
- %saveas(gcf, 'results_freq_phase_phi_1_4', 'epsc');
- close(results_freq_phase_phi_1_4);
- disp('results_freq_phase_phi_1_4 save');
- %%%%%%%%%%%%%%%%%%%%%%%% Phases End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- results_V_I_stim_I_syn_nu_phase_Recogn_4 = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- subplot(4, 5, 1);
- plot(time_V, V(:, 1), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([-80 40]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('V, mV', 'FontSize', FontSize);
- title(['V(t) for ', num2str(1), '^{st} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 2);
- plot(time_I_stim, I_stim_SF(:, 1), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 I_stim_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{stim}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{stim}(t) for ', num2str(1), '^{st} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 3);
- plot(time_I_syn, I_syn(:, 1), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 10]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{syn}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{syn}(t) for ', num2str(1), '^{st} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- %%%%%%%%%
- subplot(4, 5, 4);
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 1;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '-', 'LineWidth', 1);
- hold on;
- end
- %end
- set(gca, 'FontSize', FontSize);
- grid on;
- box on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- ax.YTick = [freq_min: d_freq: freq_max];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, s^{-1}', 'FontSize', FontSize);
- title([num2str(1), '^{st} neuron frequencies'], 'FontSize', FontSize);
- %%%%%%%%%
- subplot(4, 5, 6);
- plot(time_V, V(:, 2), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([-80 40]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('V, mV', 'FontSize', FontSize);
- title(['V(t) for ', num2str(2), '^{nd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 7);
- plot(time_I_stim, I_stim_SF(:, 2), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 I_stim_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{stim}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{stim}(t) for ', num2str(2), '^{nd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 8);
- plot(time_I_syn, I_syn(:, 2), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 10]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{syn}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{syn}(t) for ', num2str(2), '^{nd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 9);
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 2;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '-', 'LineWidth', 1);
- hold on;
- end
- %end
- set(gca, 'FontSize', FontSize);
- grid on;
- box on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- ax.YTick = [freq_min: d_freq: freq_max];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, s^{-1}', 'FontSize', FontSize);
- title([num2str(2), '^{nd} neuron frequencies'], 'FontSize', FontSize);
- subplot(4, 5, 10)
- plot(time_locs_2(1:min_time_size_RN_SN), mod(phi_RN_SN, 2*pi), '.', 'LineWidth', 1);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0 2*pi]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- yticks([0, pi/2, pi, 3*pi/2, 2*pi])
- yticklabels({'0','\pi/2','\pi','3/2 \pi','2 \pi'})
- %xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\Delta \phi_{1, 2}, rad', 'FontSize', FontSize);
- title('\Delta \phi_{1, 2}', 'FontSize', FontSize);
- subplot(4, 5, 11);
- plot(time_V, V(:, 3), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([-80 40]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('V, mV', 'FontSize', FontSize);
- title(['V(t) for ', num2str(3), '^{rd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 12);
- plot(time_I_stim, I_stim_SF(:, 3), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 I_stim_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{stim}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{stim}(t) for ', num2str(3), '^{rd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 13);
- plot(time_I_syn, I_syn(:, 3), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 10]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{syn}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{syn}(t) for ', num2str(3), '^{rd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 14);
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 3;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '-', 'LineWidth', 1);
- hold on;
- end
- %end
- set(gca, 'FontSize', FontSize);
- grid on;
- box on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- ax.YTick = [freq_min: d_freq: freq_max];
- %legend('<\nu_i>');
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, s^{-1}', 'FontSize', FontSize);
- title([num2str(3), '^{rd} neuron frequencies'], 'FontSize', FontSize);
- subplot(4, 5, 15)
- plot(time_locs_3(1:min_time_size_1_3), mod(phi_1_3, 2*pi), '.', 'LineWidth', 1);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0 2*pi]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- yticks([0, pi/2, pi, 3*pi/2, 2*pi])
- yticklabels({'0','\pi/2','\pi','3/2 \pi','2 \pi'})
- %xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\Delta \phi_{1, 3}, rad', 'FontSize', FontSize);
- title('\Delta \phi_{1, 3}', 'FontSize', FontSize);
- subplot(4, 5, 16);
- plot(time_V, V(:, 4), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([-80 40]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- xlabel('Time, s', 'FontSize', FontSize);
- ylabel('V, mV', 'FontSize', FontSize);
- title(['V(t) for ', num2str(4), '^{th} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 17);
- plot(time_I_stim, I_stim_SF(:, 4), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 I_stim_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{stim}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{stim}(t) for ', num2str(4), '^{th} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 18);
- plot(time_I_syn, I_syn(:, 4), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 10]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{syn}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{syn}(t) for ', num2str(4), '^{th} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- subplot(4, 5, 19);
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_spiking_counter = 0;
- %for i = 1:size(V, 2)
- i = 4;
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '-', 'LineWidth', 1);
- hold on;
- end
- %end
- set(gca, 'FontSize', FontSize);
- grid on;
- box on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([freq_min freq_max]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- ax.YTick = [freq_min: d_freq: freq_max];
- %legend('<\nu_i>');
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\nu, s^{-1}', 'FontSize', FontSize);
- title([num2str(4), '^{th} neuron frequencies'], 'FontSize', FontSize);
- subplot(4, 5, 20)
- plot(time_locs_4(1:min_time_size_1_4), mod(phi_1_4, 2*pi), '.', 'LineWidth', 1);
- set(gca, 'FontSize', FontSize);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0 2*pi]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- yticks([0, pi/2, pi, 3*pi/2, 2*pi])
- yticklabels({'0','\pi/2','\pi','3/2 \pi','2 \pi'})
- xlabel('Time, sec', 'FontSize', FontSize);
- ylabel('\Delta \phi_{1, 4}, rad', 'FontSize', FontSize);
- title('\Delta \phi_{1, 4}', 'FontSize', FontSize);
- saveas(gcf, 'results_V_I_stim_I_syn_nu_phase_Recogn_4.png');
- %saveas(gcf, 'results_V_I_stim_I_syn_nu_phase_Recogn_4', 'epsc');
- close(results_V_I_stim_I_syn_nu_phase_Recogn_4);
- disp('Picture results_V_I_stim_I_syn_nu_phase_Recogn_4 save');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- return
- results_I_stim_Recogn_3rd = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- plot(time_I_syn, I_syn(:, 3), 'LineWidth', 1);
- grid on;
- xlim([time_Debug_begin time_Debug_end]);
- ylim([0.0 10]);
- ax = gca;
- ax.XTick = [time_Debug_begin: d_time_Debug: time_Debug_end];
- xtickformat(xtckfrmt);
- %xlabel('Time, s', 'FontSize', FontSize);
- ylabel('I_{syn}, \muA/cm^2', 'FontSize', FontSize);
- title(['I_{syn}(t) for ', num2str(3), '^{rd} neuron'], 'FontSize', FontSize);
- set(gca, 'FontSize', FontSize);
- saveas(gcf, 'results_I_stim_Recogn_3rd.png');
- %saveas(gcf, 'results_I_stim_Recogn_3rd', 'epsc');
- close(results_I_stim_Recogn_3rd);
- disp('Picture results_I_stim_Recogn_3rd save');
- return
- % subplot(4, 1, 3);
- % plot(time_I_syn, I_syn(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 15.0]);
- % %ylim([0.0 20]);
- % ax = gca;
- % ax.XTick = [0:1:15.0];
- % xtickformat('%.1f');
- % %xlabel('Time, s', 'FontSize', 18);
- % ylabel('I_{syn}, \muA/cm^2', 'FontSize', 16);
- % %title(['I_{stim}(t) for ', num2str(ii), '^{th} pyramydal neuron. <Freq_{Poisson}> = ', num2str(meanPoissonFreq), ' Hz'], 'FontSize', 24);
- % title(['I_{syn}(t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 16);
- % set(gca, 'FontSize', 16);
- %
- % subplot(4, 1, 4);
- % plot(time_Ca, Ca(:, ii), 'LineWidth', 1);
- % hold on;
- % line([0, 15.0], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- % grid on;
- % xlim([0 15.0]);
- % ylim([0.0 0.6]);
- % ax = gca;
- % ax.XTick = [0:1:15.0];
- % xtickformat('%.1f');
- % xlabel('Time, s', 'FontSize', 16);
- % ylabel('[Ca^{2+}], \muM', 'FontSize', 16);
- % %title(['I_{stim}(t) for ', num2str(ii), '^{th} pyramydal neuron. <Freq_{Poisson}> = ', num2str(meanPoissonFreq), ' Hz'], 'FontSize', 24);
- % title(['[Ca^{2+}](t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 16);
- % set(gca, 'FontSize', 16);
- %
- % saveas(gcf, 'results_I_stim_V_I_syn_10x15_time_15_s.png');
- % %saveas(gcf, 'results_I_stim_V_I_syn', 'epsc');
- % close(results_I_stim_V_I_syn_10x15_time_15_s);
- % disp('results_I_stim_V_I_syn_10x15_time_15_s save');
- return
- filename1 = 'results_Ca.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- time_Ca = Data(:, 1);
- Ca = Data(:, 2:end);
- disp('results_Ca load complete');
- %%%%% Video %%%%
- filename1 = 'Matrix_sizes.txt';
- Data = importdata( [ path1 '/' filename1 ] );
- Neuron_width = Data(1);
- Neuron_height = Data(2);
- Astro_width = Data(3);
- Astro_height = Data(4);
- figure('units', 'normalized', 'outerposition', [0 0 1.0 1.0], 'visible', 'on');
- writerObj = VideoWriter('neuron_astro_5x7_time_30_s.avi'); % Name movie.
- writerObj.FrameRate = 60; % How many frames per second.
- open(writerObj);
- %const double dt = 0.00005
- for n = 200000: 5: 360000
- subplot(1, 2, 1);
- image_V = reshape(V(n, :), [Neuron_width, Neuron_height]);
- imagesc(image_V');
- %hold on;
- axis equal;
- axis off;
- colormap(hot);
- caxis([-80 40]);
- colorbar;
- title(['Neurons. V, mV. Layer size = ' num2str(Neuron_width) 'x' num2str(Neuron_height) '. Time = ' num2str(time_V(n), '%.5f') ' s']);
- set(gca, 'FontSize', FontSize);
- subplot(1, 2, 2);
- image_Ca = reshape(Ca(n, :), [Astro_width, Astro_height]);
- imagesc(image_Ca');
- %hold on;
- axis equal;
- axis off;
- colormap(hot);
- caxis([0 0.6]);
- colorbar;
- title(['Astrosytes. [Ca^{2+}], \muM. Layer size = ' num2str(Astro_width) 'x' num2str(Astro_height) '. Time = ' num2str(time_Ca(n), '%.5f') ' s']);
- set(gca, 'FontSize', FontSize);
- %pause(1/100000000);
- frame = getframe(gcf); % 'gcf' can handle if you zoom in to take a movie.
- writeVideo(writerObj, frame);
- end
- hold off
- close(writerObj); % Save the movie.
- disp('Video has saved');
- return
- %%% Spikes Debug Rnd %%%
- % ii = 1;
- %
- % results_I_stim_V_I_syn_10x15_time_15_s = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- %
- % subplot(4, 1, 1);
- % plot(time_I_stim, I_stim(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 15.0]);
- % %ylim([0.0 10]);
- % ax = gca;
- % ax.XTick = [0:1:15.0];
- % xtickformat('%.1f');
- % %xlabel('Time, s', 'FontSize', 18);
- % ylabel('I_{stim}, \muA/cm^2', 'FontSize', 16);
- % %title(['I_{stim}(t) for ', num2str(ii), '^{th} pyramydal neuron. <F_{in}> = ', num2str(F_in), ' Hz', 'g_{syn P} = ', num2str(g_syn_P)], 'FontSize', 24);
- % title(['I_{stim}(t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 16);
- % set(gca, 'FontSize', 16);
- %
- % subplot(4, 1, 2);
- % plot(time_V, V(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 15.0]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [0:1:15.0];
- % xtickformat('%.1f');
- % %xlabel('Time, s', 'FontSize', 18);
- % ylabel('V, mV', 'FontSize', 16);
- % title(['V(t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 16);
- % set(gca, 'FontSize', 16);
- %
- % subplot(4, 1, 3);
- % plot(time_I_syn, I_syn(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 15.0]);
- % %ylim([0.0 20]);
- % ax = gca;
- % ax.XTick = [0:1:15.0];
- % xtickformat('%.1f');
- % %xlabel('Time, s', 'FontSize', 18);
- % ylabel('I_{syn}, \muA/cm^2', 'FontSize', 16);
- % %title(['I_{stim}(t) for ', num2str(ii), '^{th} pyramydal neuron. <Freq_{Poisson}> = ', num2str(meanPoissonFreq), ' Hz'], 'FontSize', 24);
- % title(['I_{syn}(t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 16);
- % set(gca, 'FontSize', 16);
- %
- % subplot(4, 1, 4);
- % plot(time_Ca, Ca(:, ii), 'LineWidth', 1);
- % hold on;
- % line([0, 15.0], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- % grid on;
- % xlim([0 15.0]);
- % ylim([0.0 0.6]);
- % ax = gca;
- % ax.XTick = [0:1:15.0];
- % xtickformat('%.1f');
- % xlabel('Time, s', 'FontSize', 16);
- % ylabel('[Ca^{2+}], \muM', 'FontSize', 16);
- % %title(['I_{stim}(t) for ', num2str(ii), '^{th} pyramydal neuron. <Freq_{Poisson}> = ', num2str(meanPoissonFreq), ' Hz'], 'FontSize', 24);
- % title(['[Ca^{2+}](t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 16);
- % set(gca, 'FontSize', 16);
- %
- % saveas(gcf, 'results_I_stim_V_I_syn_10x15_time_15_s.png');
- % %saveas(gcf, 'results_I_stim_V_I_syn', 'epsc');
- % close(results_I_stim_V_I_syn_10x15_time_15_s);
- % disp('results_I_stim_V_I_syn_10x15_time_15_s save');
- results_neuron_raster_3x4_time_5_s = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_spiking_counter = 0;
- for i = 1:size(V, 2)
- %V_p = V(:, 1);
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([0.0 5.0]);
- ylim([0 size(V, 2)+1]);
- %rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- grid on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [0.0:0.2:5.0]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [1, [10 :10 :size(V, 2)]];
- xlabel('Time, s', 'FontSize', 20);
- ylabel('Neuron #', 'FontSize', 20);
- title(['Neurons raster'], 'FontSize', 20);
- set(gca, 'FontSize', 20);
- saveas(gcf, 'results_neuron_spiking_10x15_time_5_s.png');
- %saveas(gcf, 'results_neuron_spiking', 'epsc');
- close(results_neuron_raster_3x4_time_5_s);
- disp('Picture results_neuron_spiking_10x15_time_5_s save');
- results_neuron_spiking_10x15_time_05_s = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_spiking_counter = 0;
- for i = 1:size(V, 2)
- %V_p = V(:, 1);
- V_p = V(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_spiking_counter = regular_V_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([0.0 0.5]);
- ylim([0 size(V, 2)+1]);
- %rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- grid on;
- ax = gca;
- ax = gca;
- xtickformat('%.2f');
- set(gca, 'XTick', [0.0:0.02:0.5]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [1, [5 :5 :size(V, 2)]];
- xlabel('Time, s', 'FontSize', 20);
- ylabel('Neuron #', 'FontSize', 20);
- title(['Neurons raster'], 'FontSize', 20);
- set(gca, 'FontSize', 20);
- saveas(gcf, 'results_neuron_spiking_10x15_time_05_s.png');
- %saveas(gcf, 'results_neuron_spiking', 'epsc');
- close(results_neuron_spiking_10x15_time_05_s);
- disp('results_neuron_spiking_10x15_time_05_s save');
- % results_neuron_spiking_10x15_time_15_s = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- %
- % if (size(time_V, 2) > size(time_V, 1))
- % time_V = time_V';
- % end
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([0 15.0]);
- % ylim([0 size(V, 2)+1]);
- % %rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % grid on;
- % ax = gca;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [0:1:15.0]);
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [1, [10 :10 :size(V, 2)]];
- % xlabel('Time, s', 'FontSize', 20);
- % ylabel('Neuron #', 'FontSize', 20);
- % title(['Neurons raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 20);
- %
- % saveas(gcf, 'results_neuron_spiking_10x15_time_15_s.png');
- % %saveas(gcf, 'results_neuron_spiking', 'epsc');
- % close(results_neuron_spiking_10x15_time_15_s);
- % disp('results_neuron_spiking_10x15_time_15_s save');
- % results_neuron_spiking_30x40_detailed = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- %
- % if (size(time_V, 2) > size(time_V, 1))
- % time_V = time_V';
- % end
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([0.20 0.35]);
- % ylim([0 size(V, 2)+1]);
- % %rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % grid on;
- % ax = gca;
- % ax = gca;
- % xtickformat('%.2f');
- % set(gca, 'XTick', [0.20:0.01:0.35]);
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [1, [30 :30 :size(V, 2)]];
- % xlabel('Time, s', 'FontSize', 20);
- % ylabel('Neuron #', 'FontSize', 20);
- % title(['Neurons raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 20);
- %
- % saveas(gcf, 'results_neuron_spiking_30x40_detailed.png');
- % %saveas(gcf, 'results_neuron_spiking', 'epsc');
- % close(results_neuron_spiking_30x40_detailed);
- % disp('results_neuron_spiking_30x40_detailed save');
- % results_image_E_syn = figure('units', 'normalized', 'outerposition', [0 0 1 1]);
- % image_E_syn = reshape(E_syn, [40, 50]);
- % imagesc(image_E_syn');
- % %hold on;
- % axis equal;
- % axis off;
- % %MyColorMap = [1 0 0] [0 1 0];
- % %MyColorMap = {'#FF0000', '#00FF00'};
- % %colormap(MyColorMap);
- % colormap(gray(2));
- % caxis([-90 0]);
- % cbh = colorbar('v');
- % set(cbh, 'YTick', [-90 0]);
- % %caxis([-80 40]);
- % colorbar;
- % title(['Neurons. E_{syn}, mV. Layer size = ' num2str(40) 'x' num2str(50) '.']);
- % set(gca, 'FontSize', 20);
- % saveas(gcf, 'results_image_E_syn.png');
- % %saveas(gcf, 'results_image_E_syn', 'epsc');
- % close(results_image_E_syn);
- % disp('results_image_E_syn save');
- return
- %%%%% Correlation Begin %%%%%%
- theta = time_V;
- x1 = V(:, 1);
- x2 = V(:, 12);
- % theta = linspace(0,2*pi,100);
- % x1 = sin(theta);
- % x2 = sin(1.2*theta);
- [r, lags] = xcorr(x1,x2);
- clf()
- figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- tiledlayout(2,1)
- nexttile
- hold on
- plot(theta, x1, 'DisplayName', 'x1')
- plot(theta, x2, 'DisplayName', 'x2')
- legend()
- nexttile
- plot(lags,r, '-');
- xlim([-0.05 0.05]);
- grid on
- xlabel('lag')
- ylabel('cross-corr');
- %%%%% Correlation End %%%%%%%%
- return
- figure('units', 'normalized', 'outerposition', [0 0 1 1]);
- writerObj = VideoWriter('neuron_10x15_time_5_s.avi'); % Name movie.
- writerObj.FrameRate = 45; % How many frames per second.
- open(writerObj);
- for n = 1:20:size(V, 1)
- image_V = reshape(V(n, :), [10, 15]);
- imagesc(image_V');
- %hold on;
- axis equal;
- axis off;
- colormap(hot);
- caxis([-80 40]);
- colorbar;
- title(['Neurons. V, mV. Layer size = ' num2str(10) 'x' num2str(15) '. Time = ' num2str(time_V(n), '%.5f') ' s']);
- set(gca, 'FontSize', 20);
- %pause(1/100000000);
- frame = getframe(gcf); % 'gcf' can handle if you zoom in to take a movie.
- writeVideo(writerObj, frame);
- end
- hold off
- close(writerObj); % Save the movie.
- return
- figure('units', 'normalized', 'outerposition', [0 0 1 1]);
- writerObj = VideoWriter('astro_90x100_time_3_s.avi'); % Name movie.
- writerObj.FrameRate = 30; % How many frames per second.
- open(writerObj);
- for n = 1:5000:size(Ca, 1)
- image_Ca = reshape(Ca(n, :), [90, 100]);
- imagesc(image_Ca');
- %hold on;
- axis equal;
- axis off;
- colormap(hot);
- caxis([0 0.6]);
- colorbar;
- title(['Astrocytes. [Ca^{2+}], \muM. Layer size = ' num2str(90) 'x' num2str(100) '. Time = ' num2str(time_Ca(n), '%.5f') ' s']);
- set(gca, 'FontSize', 20);
- %pause(1/100000000);
- frame = getframe(gcf); % 'gcf' can handle if you zoom in to take a movie.
- writeVideo(writerObj, frame);
- end
- hold off
- close(writerObj); % Save the movie.
- return
- clear all;
- return
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % filename0 = 'A_A.txt';
- % path0 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % Data_A_A = importdata( [ path0 '/' filename0 ] );
- %
- % filename1 = 'A_N.txt';
- % path1 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % Data_A_N = importdata( [ path1 '/' filename1 ] );
- %
- % filename2 = 'results_E_syn.txt';
- % path1 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % E_syn = importdata( [ path1 '/' filename2 ] );
- %
- % Data_A_N = Data_A_N.*(2*sign(repmat(E_syn,1,size(Data_A_N,2)))+1);
- %
- % filename3 = 'p_rewir.txt';
- % path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % Data = importdata( [ path3 '/' filename3 ] );
- % p_rewir = Data(1, 1);
- %filename3 = 'p_inhib.txt';
- %path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- %Data = importdata( [ path3 '/' filename3 ] );
- %p_inhib = Data(1, 1);
- % fig_A_A_A_N = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % ax221 = subplot(1, 2, 1);
- % imshow(Data_A_A);
- % %axis ij;
- % axis('on', 'image');
- % %axis equal;
- % daspect([1 1 1])
- % %%axis off;
- % colormap(ax221, gray(2));
- % caxis([0 1]);
- % cbh = colorbar('v');
- % set(cbh, 'YTick', [0:1:1]);
- % %set(gca, 'XTick', [1 size(Data_A_A, 1)/2 size(Data_A_A, 1)]);
- % %set(gca, 'YTick', [1 size(Data_A_A, 2)/2 size(Data_A_A, 2)]);
- % set(gca, 'XTick', [1, 25 :25 :size(Data_A_A, 1)]);
- % set(gca, 'YTick', [1, 25 :25 :size(Data_A_A, 2)]);
- % ax = gca;
- % ax.XAxisLocation = 'top';
- % title('Astrocytes adjacency matrix');
- % set(gca, 'FontSize', 25);
- %
- % ax222 = subplot(1, 2, 2);
- % imshow(Data_A_N);
- % %axis ij;
- % axis('on', 'image');
- % %axis equal;
- % daspect([1 1 1])
- % %%axis off;
- % colormap(ax222, [1 0 0; 0 0 0; 1 1 1]);
- % %colormap(ax222, gray(3));
- % caxis([-1 1]);
- % cbh = colorbar('v');
- % set(cbh, 'YTick', [-1:1:1], 'YTickLabel', {'Inhib conn', 'No conn', 'Excit conn'});
- % %set(gca, 'XTick', [1 size(Data_A_N, 1)/2 size(Data_A_N, 1)]);
- % %set(gca, 'YTick', [1 size(Data_A_N, 2)/2 size(Data_A_N, 2)]);
- % set(gca, 'XTick', [1, 25 :25 :size(Data_A_N, 1)]);
- % set(gca, 'YTick', [1, 25 :25 :size(Data_A_N, 2)]);
- % ax = gca;
- % ax.XAxisLocation = 'top';
- % title(['Neurons adjacency matrix. p_{rewir} = ', num2str(p_rewir), '; p_{inhib} = ', num2str(p_inhib)]);
- % set(gca, 'FontSize', 25);
- %
- % saveas(gcf, 'A_A_A_N.png');
- % saveas(gcf, 'A_A_A_N', 'epsc');
- % close(fig_A_A_A_N);
- % disp('A_A & A_N save');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % filename3 = 'results_V_P_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_m08.txt';
- % path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % Data = importdata( [ path3 '/' filename3 ] );
- % %time_V = Data(round(0.25*end):end, 1);
- % time_V_P = Data(:, 1);
- % %V = Data(round(0.25*end):end, 2:end);
- % V_P = Data(:, 2:end);
- % %time = Data(4800000:end, 1);
- % %V = Data(4800000:end, 2:end);
- % %time = Data(100000:end, 1);
- % %V = Data(100000:end, 2:end);
- % %clear Data;
- % disp('results_V_P load complete');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- filename3 = 'results_V_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_m08.txt';
- path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data = importdata( [ path3 '/' filename3 ] );
- %time_V = Data(round(0.25*end):end, 1);
- time_V = Data(:, 1);
- %V = Data(round(0.25*end):end, 2:end);
- V_m08 = Data(:, 2:end);
- %time = Data(4800000:end, 1);
- %V = Data(4800000:end, 2:end);
- %time = Data(100000:end, 1);
- %V = Data(100000:end, 2:end);
- %clear Data;
- disp('results_V_m08 load complete');
- filename3 = 'results_V_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_10.txt';
- path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data = importdata( [ path3 '/' filename3 ] );
- %time_V = Data(round(0.25*end):end, 1);
- time_V = Data(:, 1);
- %V = Data(round(0.25*end):end, 2:end);
- V_10 = Data(:, 2:end);
- %time = Data(4800000:end, 1);
- %V = Data(4800000:end, 2:end);
- %time = Data(100000:end, 1);
- %V = Data(100000:end, 2:end);
- %clear Data;
- disp('results_V_10 load complete');
- filename2 = 'results_Ca_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_m08.txt';
- path2 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data = importdata( [ path2 '/' filename2 ] );
- %time_Ca = Data(round(0.25*end):end, 1);
- time_Ca = Data(:, 1);
- %Ca = Data(round(0.25*end):end, 2:end);
- Ca_m08 = Data(:, 2:end);
- %time = Data(4800000:end, 1);
- %Ca = Data(4800000:end, 2:end);
- clear Data;
- disp('results_Ca_m08 load complete');
- filename2 = 'results_Ca_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_10.txt';
- path2 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data = importdata( [ path2 '/' filename2 ] );
- %time_Ca = Data(round(0.25*end):end, 1);
- time_Ca = Data(:, 1);
- %Ca = Data(round(0.25*end):end, 2:end);
- Ca_10 = Data(:, 2:end);
- %time = Data(4800000:end, 1);
- %Ca = Data(4800000:end, 2:end);
- clear Data;
- disp('results_Ca_10 load complete');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % filename6 = 'test_Poisson_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_m08.txt';
- % path6 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % Data = importdata( [ path6 '/' filename6 ] );
- % time = Data(:, 1);
- %
- % meanPoissonTimeData = mean(Data);
- % meanPoissonFreq = 1 / meanPoissonTimeData
- %
- % % results_test_Poisson = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % % plot(time, 'LineWidth', 1);
- % % hold on;
- % % plot([0, size(Data, 1)], [meanPoissonTimeData, meanPoissonTimeData], 'r', 'LineWidth', 2);
- % % grid on;
- % % set(gca, 'FontSize', 24);
- % % xlabel('Intervals (custom value)', 'FontSize', 50);
- % % ylabel('Time, msec', 'FontSize', 50);
- % % title('Time Poisson interval', 'FontSize', 50);
- % % saveas(gcf, 'test_Poisson.png');
- % % close(results_test_Poisson);
- % % disp('test_Poisson save');
- %
- % filename4 = 'results_I_stim_g_syn_0010_g_syn_P_07_PoisFr_260_g_astro_m08.txt';
- % path4 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- % Data = importdata( [ path4 '/' filename4 ] );
- % time = Data(:, 1);
- % I_stim = Data(:, 2:end);
- % disp('results_I_stim load complete');
- %
- % ii = 5;
- % results_I_stim = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % subplot(3, 1, 1);
- % plot(time, I_stim(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 3]);
- % %ylim([-0.2 0.2]);
- % ax = gca;
- % ax.XTick = [0:0.1:3];
- % %xlabel('Time, s', 'FontSize', 24);
- % ylabel('I_{stim}, \muA/cm^2', 'FontSize', 24);
- % title(['I_{stim}(t) for ', num2str(ii), '^{th} neuron. <Freq_{Poisson}> = ', num2str(meanPoissonFreq), ' Hz'], 'FontSize', 24);
- % set(gca, 'FontSize', 24);
- %
- % subplot(3, 1, 2);
- % plot(time_V_P, V_P(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 3]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [0:0.1:3];
- % %xlabel('Time, s', 'FontSize', 24);
- % ylabel('V, mV', 'FontSize', 24);
- % title(['V_{P}(t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 24);
- % set(gca, 'FontSize', 24);
- %
- % subplot(3, 1, 3);
- % plot(time_V, V(:, ii), 'LineWidth', 1);
- % grid on;
- % xlim([0 3]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [0:0.1:3];
- % xlabel('Time, s', 'FontSize', 24);
- % ylabel('V, mV', 'FontSize', 24);
- % title(['V(t) for ', num2str(ii), '^{th} neuron'], 'FontSize', 24);
- % set(gca, 'FontSize', 24);
- %
- % saveas(gcf, 'results_I_stim.png');
- % %saveas(gcf, 'results_I_stim', 'epsc');
- % close(results_I_stim);
- % disp('results_I_stim save');
- %%%%%%%%%%%%% V_P Freq %%%%%%%%%%%%%%
- % results_V_P_Freq = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % subplot(3, 1, 1);
- % plot(time_V_P, V_P(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 5]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [0:0.1:5];
- % %xlabel('Time, s', 'FontSize', 14);
- % ylabel('V, mV', 'FontSize', 14);
- % title('V_P_i(t)', 'FontSize', 15);
- %
- % subplot(3, 1, 2);
- % %time_V_P = time_V_P';
- % regular_V_P_spiking_counter = 0;
- % for i = 1:size(V_P, 2)
- % %V_p = V(:, 1);
- % V_P_p = V_P(:, i);
- % [pks, locs] = findpeaks(V_P_p, time_V_P, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_P_spiking_counter = regular_V_P_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 4, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- % end
- %
- % xlim([0 5]);
- % ylim([0 size(V_P, 2)+1]);
- % ax = gca;
- % ax.XTick = [0:0.1:5];
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:50:size(V_P, 2)];
- % %xlabel('Time, s', 'FontSize', 20);
- % ylabel('Neuron number', 'FontSize', 20);
- % title(['Poissons neurons time spikes raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 15);
- %
- % subplot(3, 1, 3);
- % %left_color = [0 0 0];
- % %right_color = [1 0 0];
- % %set(results_raster_V_fre_1, 'defaultAxesColorOrder', [left_color; right_color]);
- % %set(gca, 'FontSize', 14);
- % omega_cur = 0;
- % omega_total = [];
- % time_total = [];
- % %yyaxis left;
- % regular_V_P_spiking_counter = 0;
- % for i = 1:size(V_P, 2)
- % %i = 4;
- % V_P_p = V_P(:, i);
- % [pks, locs] = findpeaks(V_P_p, time_V_P, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- %
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- %
- % if isempty([pks, locs]) || size(pks, 1) == 1
- % omega_cur = 0;
- % omega_total = [omega_total omega_cur'];
- % %time_locs = time_V(locs);
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % regular_V_P_spiking_counter = regular_V_P_spiking_counter + 1;
- % %omega_cur = 1./diff(time_V(locs));
- % omega_cur = 1./diff(locs);
- % %omega_cur = omega_cur(find(omega_cur'<=60));
- % omega_total = [omega_total omega_cur'];
- % %time_locs = time_V(locs);
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- %
- % %if ~isempty([pks, locs])
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % plot(time_locs, omega_cur, '.-');
- % hold on;
- % end
- % end
- %
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 5]);
- % ylim([0 50]);
- % ax = gca;
- % ax.XTick = [0:0.1:5];
- % ax.YTick = [0:5:50];
- % %legend('<\nu_P_i>');
- % xlabel('Time, s', 'FontSize', 14);
- % ylabel('\nu, s^{-1}', 'FontSize', 14);
- % title('\nu_P_i', 'FontSize', 15);
- %
- % saveas(gcf, 'results_V_P_Freq.png');
- % %saveas(gcf, 'results_V_Freq', 'epsc');
- % close(results_V_P_Freq);
- % disp('results_V_P_Freq save');
- %%%%%%%%%%%%% V_P Freq END %%%%%%%%%%%%%%
- % results_Ca_V_Freq = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % subplot(3, 1, 1);
- % line([0, 60], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- % hold on;
- % plot(time_Ca, Ca(:, :), 'LineWidth', 1);
- % hold on;
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 60]);
- % ylim([0 0.7]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % %xlabel('Time, s', 'FontSize', 14);
- % ylabel('[Ca^{2+}], \muM', 'FontSize', 14);
- % title('[Ca^{2+}]_i(t)', 'FontSize', 15);
- %
- % subplot(3, 1, 2);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 3]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [0:0.1:3];
- % %xlabel('Time, s', 'FontSize', 14);
- % ylabel('V, mV', 'FontSize', 14);
- % title('V_i(t)', 'FontSize', 15);
- %
- % % saveas(gcf, 'results_Ca_V.png');
- % % %saveas(gcf, 'results_Ca_V', 'epsc');
- % % close(results_Ca_V);
- % % disp('results_Ca_V save');
- % %%%%%%%%%%%%% End All Ca_V_i %%%%%%%%%%%%%%%%%%
- % subplot(3, 1, 3);
- %
- % %left_color = [0 0 0];
- % %right_color = [1 0 0];
- % %set(results_raster_V_fre_1, 'defaultAxesColorOrder', [left_color; right_color]);
- % %set(gca, 'FontSize', 14);
- % omega_cur = 0;
- % omega_total = [];
- % time_total = [];
- % %yyaxis left;
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %i = 4;
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- %
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- %
- % if isempty([pks, locs]) || size(pks, 1) == 1
- % omega_cur = 0;
- % omega_total = [omega_total omega_cur'];
- % %time_locs = time_V(locs);
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % %omega_cur = 1./diff(time_V(locs));
- % omega_cur = 1./diff(locs);
- % %omega_cur = omega_cur(find(omega_cur'<=60));
- % omega_total = [omega_total omega_cur'];
- % %time_locs = time_V(locs);
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- %
- % %N_time_array(i, ismember(time, time_locs)) = omega_cur;
- % %N_time_array(i, ismember(round(time_V*1e5), round(time_locs*1e5))) = omega_cur;
- %
- % %if ~isempty([pks, locs])
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % plot(time_locs, omega_cur, '.-');
- % hold on;
- % end
- % end
- %
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 3]);
- % ylim([0 40]);
- % ax = gca;
- % ax.XTick = [0:0.1:3];
- % ax.YTick = [0:5:40];
- % %legend('<\nu_i>');
- % xlabel('Time, s', 'FontSize', 14);
- % ylabel('\nu, s^{-1}', 'FontSize', 14);
- % title('\nu_i', 'FontSize', 15);
- %
- % saveas(gcf, 'results_Ca_V_Freq.png');
- % %saveas(gcf, 'results_V_Freq', 'epsc');
- % close(results_Ca_V_Freq);
- % disp('results_Ca_V_Freq save');
- %%%%%%%%%%%%%%%%% Raster START %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % filename2 = 'results_V_spikes.txt';
- % path2 = '/Users/sergeymakovkin/Documents/Ring_Parall_Debian';
- % Data = importdata( [ path2 '/' filename2 ] );
- % time_Ca = Data(round(0.25*end):end, 1);
- % time_V_Raster = Data(:, 1);
- % Ca = Data(round(0.25*end):end, 2:end);
- % V_Raster = Data(:, 2:end);
- % time = Data(4800000:end, 1);
- % Ca = Data(4800000:end, 2:end);
- % clear Data;
- % disp('results_V_spikes load complete');
- N = size(V_m08, 2);
- t_V_end = time_V(end);
- %t_end = 40.0;
- t_V_start = round(0.25*t_V_end);
- dt = time_V(2) - time_V(1);
- %dt = 0.00005;
- %time_V = t_V_start:dt:t_V_end;
- time_V = time_V';
- N_time_V_array = zeros(N, numel(time_V));
- t_Ca_end = time_Ca(end);
- t_Ca_start = 0;
- dt = time_Ca(2) - time_Ca(1);
- time_Ca = t_Ca_start:dt:t_Ca_end;
- time_Ca = time_Ca';
- N_time_Ca_array = zeros(N, numel(time_Ca));
- % results_raster_V_P_V_all = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % subplot(2, 1, 1);
- % %time_V_P = time_V_P';
- % regular_V_P_spiking_counter = 0;
- % for i = 1:size(V_P, 2)
- % %V_p = V(:, 1);
- % V_P_p = V_P(:, i);
- % [pks, locs] = findpeaks(V_P_p, time_V_P, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_P_spiking_counter = regular_V_P_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 4, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([0 5]);
- % ylim([0 size(V_P, 2)+1]);
- % ax = gca;
- % ax.XTick = [0:0.1:5];
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:50:size(V_P, 2)];
- % %xlabel('Time of spikes, s', 'FontSize', 20);
- % ylabel('Neuron number', 'FontSize', 20);
- % title(['Poissons neurons time spikes raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 18);
- %
- % % saveas(gcf, 'results_raster_V_P_all.png');
- % % %saveas(gcf, 'results_raster_V_all', 'epsc');
- % % close(results_raster_V_P_all);
- % % %clear;
- % % disp('results_raster_V_P_all save');
- %
- % %results_raster_V_all = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % subplot(2, 1, 2);
- % time_V = time_V';
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 4, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([0 5]);
- % ylim([0 size(V, 2)+1]);
- % ax = gca;
- % ax.XTick = [0:0.1:5];
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:50:size(V, 2)];
- % xlabel('Time of spikes, s', 'FontSize', 20);
- % ylabel('Neuron number', 'FontSize', 20);
- % title(['Neurons time spikes raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 18);
- %
- % saveas(gcf, 'results_raster_V_P_V_all.png');
- % %saveas(gcf, 'results_raster_V_P_V_all', 'epsc');
- % close(results_raster_V_P_V_all);
- % %clear;
- % disp('results_raster_V_P_V_all save');
- filename1 = 'corr_not_zero_g_astro_m08_01.txt';
- path1 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data1 = importdata( [ path1 '/' filename1 ] );
- time_k_syn = Data1(:, 1);
- k_syn1_m08 = Data1(:, 2);
- filename2 = 'corr_not_zero_g_astro_m08_02.txt';
- path2 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data2 = importdata( [ path2 '/' filename2 ] );
- time_k_syn = Data2(:, 1);
- k_syn2_m08 = Data2(:, 2);
- filename3 = 'corr_not_zero_g_astro_m08_03.txt';
- path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data3 = importdata( [ path3 '/' filename3 ] );
- time_k_syn = Data3(:, 1);
- k_syn3_m08 = Data3(:, 2);
- filename4 = 'corr_not_zero_g_astro_m08_04.txt';
- path4 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data4 = importdata( [ path4 '/' filename4 ] );
- time_k_syn = Data4(:, 1);
- k_syn4_m08 = Data4(:, 2);
- filename5 = 'corr_not_zero_g_astro_m08_05.txt';
- path5 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data5 = importdata( [ path5 '/' filename5 ] );
- time_k_syn = Data5(:, 1);
- k_syn5_m08 = Data5(:, 2);
- filename6 = 'corr_not_zero_g_astro_m08_06.txt';
- path6 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data6 = importdata( [ path6 '/' filename6 ] );
- time_k_syn = Data6(:, 1);
- k_syn6_m08 = Data6(:, 2);
- filename7 = 'corr_not_zero_g_astro_m08_07.txt';
- path7 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data7 = importdata( [ path7 '/' filename7 ] );
- time_k_syn = Data7(:, 1);
- k_syn7_m08 = Data7(:, 2);
- filename8 = 'corr_not_zero_g_astro_m08_08.txt';
- path8 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data8 = importdata( [ path8 '/' filename8 ] );
- time_k_syn = Data8(:, 1);
- k_syn8_m08 = Data8(:, 2);
- filename9 = 'corr_not_zero_g_astro_m08_09.txt';
- path9 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data9 = importdata( [ path9 '/' filename9 ] );
- time_k_syn = Data9(:, 1);
- k_syn9_m08 = Data9(:, 2);
- filename10 = 'corr_not_zero_g_astro_m08_10.txt';
- path10 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data10 = importdata( [ path10 '/' filename10 ] );
- time_k_syn = Data10(:, 1);
- k_syn10_m08 = Data10(:, 2);
- k_syn_m08 = mean([k_syn1_m08, k_syn2_m08, k_syn3_m08, k_syn4_m08, k_syn5_m08, k_syn6_m08, k_syn7_m08, k_syn8_m08, k_syn9_m08, k_syn10_m08], 2);
- disp('results_k_syn_m08 load complete');
- %%%%
- filename1 = 'corr_not_zero_g_astro_10_01.txt';
- path1 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data1 = importdata( [ path1 '/' filename1 ] );
- time_k_syn = Data1(:, 1);
- k_syn1_10 = Data1(:, 2);
- filename2 = 'corr_not_zero_g_astro_10_02.txt';
- path2 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data2 = importdata( [ path2 '/' filename2 ] );
- time_k_syn = Data2(:, 1);
- k_syn2_10 = Data2(:, 2);
- filename3 = 'corr_not_zero_g_astro_10_03.txt';
- path3 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data3 = importdata( [ path3 '/' filename3 ] );
- time_k_syn = Data3(:, 1);
- k_syn3_10 = Data3(:, 2);
- filename4 = 'corr_not_zero_g_astro_10_04.txt';
- path4 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data4 = importdata( [ path4 '/' filename4 ] );
- time_k_syn = Data4(:, 1);
- k_syn4_10 = Data4(:, 2);
- filename5 = 'corr_not_zero_g_astro_10_05.txt';
- path5 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data5 = importdata( [ path5 '/' filename5 ] );
- time_k_syn = Data5(:, 1);
- k_syn5_10 = Data5(:, 2);
- filename6 = 'corr_not_zero_g_astro_10_06.txt';
- path6 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data6 = importdata( [ path6 '/' filename6 ] );
- time_k_syn = Data6(:, 1);
- k_syn6_10 = Data6(:, 2);
- filename7 = 'corr_not_zero_g_astro_10_07.txt';
- path7 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data7 = importdata( [ path7 '/' filename7 ] );
- time_k_syn = Data7(:, 1);
- k_syn7_10 = Data7(:, 2);
- filename8 = 'corr_not_zero_g_astro_10_08.txt';
- path8 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data8 = importdata( [ path8 '/' filename8 ] );
- time_k_syn = Data8(:, 1);
- k_syn8_10 = Data8(:, 2);
- filename9 = 'corr_not_zero_g_astro_10_09.txt';
- path9 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data9 = importdata( [ path9 '/' filename9 ] );
- time_k_syn = Data9(:, 1);
- k_syn9_10 = Data9(:, 2);
- filename10 = 'corr_not_zero_g_astro_10_10.txt';
- path10 = '/Users/sergeymakovkin/Documents/3_Rings/Ver_2_2021_03_09';
- Data10 = importdata( [ path10 '/' filename10 ] );
- time_k_syn = Data10(:, 1);
- k_syn10_10 = Data10(:, 2);
- k_syn_10 = mean([k_syn1_10, k_syn2_10, k_syn3_10, k_syn4_10, k_syn5_10, k_syn6_10, k_syn7_10, k_syn8_10, k_syn9_10, k_syn10_10], 2);
- disp('results_k_syn_10 load complete');
- % results_k_syn_only = figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % plot(time_k_syn, k_syn, 'LineWidth', 1);
- % hold on;
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 60]);
- % ylim([0 1.0]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax = gca;
- % ax.YTick = [0:0.1:1.0];
- % xlabel('Time, s', 'FontSize', 14);
- % ylabel('k_{syn}', 'FontSize', 14);
- % title('k_{syn}', 'FontSize', 14);
- % set(gca, 'FontSize', 14)
- % saveas(gcf, 'results_k_syn_only.png');
- % %saveas(gcf, 'results_k_syn_only', 'epsc');
- % close(results_k_syn_only);
- % disp('results_k_syn_only save');
- % results_raster_Ca_V_all = figure('units', 'normalized', 'outerposition', [0 0 0.6 1], 'visible', 'on');
- % subplot(8, 2, [1 2]);
- % line([0, 60], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- % hold on;
- % plot(time_Ca, Ca(:, :), 'LineWidth', 1);
- % hold on;
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 60]);
- % ylim([0 0.7]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax = gca;
- % ax.YTick = [0:0.1:0.7];
- % %xlabel('Time, sec', 'FontSize', 14);
- % ylabel('[Ca^{2+}], (\muM)', 'FontSize', 14);
- % title('[Ca^{2+}]_i(t)', 'FontSize', 14);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, [3 4]);
- % regular_Ca_spiking_counter = 0;
- % for i = 1:size(Ca, 2)
- % Ca_p = Ca(:, i);
- % [pks, locs] = findpeaks(Ca_p, 'MinPeakHeight', 0.3);
- % if ~isempty([pks, locs])
- % regular_Ca_spiking_counter = regular_Ca_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(time_Ca(locs), pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % N_time_Ca_array(i, ismember(round(time_Ca*1e5), round(time_Ca(locs)*1e5))) = 1;
- % end
- % xlim([0 60]);
- % ylim([0 size(Ca, 2)+1]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:50:size(Ca, 2)];
- % %xlabel('Time of spikes, sec', 'FontSize', 20);
- % ylabel('Astrocyte number', 'FontSize', 20);
- % title(['Astrocytes time spikes raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, [5 6]);
- % dt_Ca_shift = 2.0; % sec
- % k_Ca = round(dt_Ca_shift / dt);
- %
- % total_spykes_Ca = zeros(1, size(N_time_Ca_array, 2));
- % for i = 1:size(V, 2)
- % total_spykes_Ca = total_spykes_Ca + N_time_Ca_array(i, :);
- % end
- % Count_shift_Ca_sum = movsum(total_spykes_Ca, k_Ca);
- %
- % % Count_shift_sum = zeros(1, size(N_time_V_array, 2));
- % % for i = 1:size(V, 2)
- % % Count_shift = movsum(N_time_V_array(i, :), k);
- % % Count_shift_sum = Count_shift_sum + Count_shift;
- % % end
- %
- % % figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % % plot(time_Ca, total_spykes_Ca, '-');
- % % xlim([10 40]);
- %
- % %figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % plot(time_Ca, Count_shift_Ca_sum, 'r-', 'LineWidth', 1);
- % xlim([0 60]);
- % ylim([0 size(Ca, 2)]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax.YTick = [0:50:size(Ca, 2)];
- % title(['Astrocytes slide window spikes sum'], 'FontSize', 12);
- % ylabel('Shift sum', 'FontSize', 12);
- % %xlabel('Time of spikes, sec', 'FontSize', 12);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, [7 8]);
- % %time_V = time_V';
- % omega_cur = 0;
- % omega_total = [];
- % time_total = [];
- % %yyaxis left;
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %i = 24;
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- %
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- %
- % if isempty([pks, locs]) || size(pks, 1) == 1
- % omega_cur = 0;
- % omega_total = [omega_total omega_cur'];
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % omega_cur = 1./diff(locs);
- % %omega_cur = omega_cur(find(omega_cur'<=60));
- % omega_total = [omega_total omega_cur'];
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- %
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % plot(time_locs, omega_cur, '.-');
- % hold on;
- % end
- % end
- %
- % set(gca, 'FontSize', 12);
- % grid on;
- % xlim([0 60]);
- % ylim([0 40]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax.YTick = [0:5:40];
- % %legend('<\nu_i>');
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('\nu, s^{-1}', 'FontSize', 12);
- % title('Neurons frequencies, \nu_i', 'FontSize', 12);
- % time_V = time_V';
- %
- % subplot(8, 2, [9 10]);
- % plot(time_k_syn, k_syn, 'LineWidth', 1);
- % hold on;
- % set(gca, 'FontSize', 14);
- % grid on;
- % xlim([0 60]);
- % ylim([0 1.0]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax = gca;
- % ax.YTick = [0:0.2:1.0];
- % %xlabel('Time, s', 'FontSize', 12);
- % ylabel('k_{syn}', 'FontSize', 12);
- % title('k_{syn}', 'FontSize', 14);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, 11);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 12);
- % grid on;
- % xlim([15 16]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [15:0.1:16];
- % ax.YTick = [-80:40:40];
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 12);
- % title('V_i(t)', 'FontSize', 12);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, 13);
- % time_V = time_V';
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([15 16]);
- % ylim([0 size(V, 2)+1]);
- % ax = gca;
- % ax.XTick = [15:0.1:16];
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:50:size(V, 2)];
- % %xlabel('Time of spikes, sec', 'FontSize', 20);
- % ylabel('Neuron number', 'FontSize', 20);
- % title(['Neurons time spikes raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, 15);
- % dt_V_shift = 0.030; % sec
- % k_V = round(dt_V_shift / dt);
- %
- % total_spykes = zeros(1, size(N_time_V_array, 2));
- % for i = 1:size(V, 2)
- % total_spykes = total_spykes + N_time_V_array(i, :);
- % end
- % Count_shift_sum = movsum(total_spykes, k_V);
- %
- % % Count_shift_sum = zeros(1, size(N_time_V_array, 2));
- % % for i = 1:size(V, 2)
- % % Count_shift = movsum(N_time_V_array(i, :), k);
- % % Count_shift_sum = Count_shift_sum + Count_shift;
- % % end
- %
- % % figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % % plot(time_V, total_spykes, '-');
- % % xlim([10 20]);
- %
- % %figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % plot(time_V, Count_shift_sum, 'b-');
- % xlim([15 16]);
- % ylim([0 size(V, 2)+1]);
- % ax = gca;
- % ax.XTick = [15:0.1:16];
- % ax.YTick = [0:50:size(V, 2)];
- % title(['Neurons slide window spikes sum'], 'FontSize', 12);
- % xlabel('Time, s', 'FontSize', 12);
- % ylabel('Shift sum', 'FontSize', 12);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, 12);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 12);
- % grid on;
- % xlim([19 20]);
- % ylim([-80 40]);
- % ax = gca;
- % ax.XTick = [19:0.1:20];
- % ax.YTick = [-80:40:40];
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 12);
- % title('V_i(t)', 'FontSize', 12);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, 14);
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([19 20]);
- % ylim([0 size(V, 2)+1]);
- % ax = gca;
- % ax.XTick = [19:0.1:20];
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:50:size(V, 2)];
- % %xlabel('Time of spikes, sec', 'FontSize', 20);
- % ylabel('Neuron number', 'FontSize', 20);
- % title(['Neurons time spikes raster'], 'FontSize', 20);
- % set(gca, 'FontSize', 12);
- %
- % subplot(8, 2, 16);
- % dt_V_shift = 0.030; % sec
- % k_V = round(dt_V_shift / dt);
- %
- % total_spykes = zeros(1, size(N_time_V_array, 2));
- % for i = 1:size(V, 2)
- % total_spykes = total_spykes + N_time_V_array(i, :);
- % end
- % Count_shift_sum = movsum(total_spykes, k_V);
- %
- % % Count_shift_sum = zeros(1, size(N_time_V_array, 2));
- % % for i = 1:size(V, 2)
- % % Count_shift = movsum(N_time_V_array(i, :), k);
- % % Count_shift_sum = Count_shift_sum + Count_shift;
- % % end
- %
- % % figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % % plot(time_V, total_spykes, '-');
- % % xlim([10 20]);
- %
- % %figure('units', 'normalized', 'outerposition', [0 0 1 1], 'visible', 'on');
- % plot(time_V, Count_shift_sum, 'b-');
- % xlim([19 20]);
- % ylim([0 size(V, 2)+1]);
- % ax = gca;
- % ax.XTick = [19:0.1:20];
- % ax.YTick = [0:50:size(V, 2)];
- % title(['Neurons slide window spikes sum'], 'FontSize', 12);
- % xlabel('Time, s', 'FontSize', 12);
- % ylabel('Shift sum', 'FontSize', 12);
- % set(gca, 'FontSize', 12);
- %
- % saveas(gcf, 'results_raster_Ca_V_all.png');
- % %saveas(gcf, 'results_raster_V_all', 'epsc');
- % close(results_raster_Ca_V_all);
- % %clear;
- % disp('results_raster_Ca_V_all save');
- %%%%%%%%%%%%%%%%%%%%%
- % results_presentation_raster_Ca_V_all = figure('units', 'normalized', 'outerposition', [0 0 0.6 1], 'visible', 'on');
- % subplot(5, 2, [1 2]);
- % line([0, 60], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- % hold on;
- % plot(time_Ca, Ca(:, :), 'LineWidth', 1);
- % hold on;
- % rectangle('Position',[33 0 1 0.7], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- % rectangle('Position',[37 0 1 0.7], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- % %grid on;
- % xlim([24 50]);
- % ylim([0 0.7]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax = gca;
- % ytickformat('%.1f');
- % set(gca, 'YTick', [0.0 : 0.2 : 0.7]);
- % %xlabel('Time, sec', 'FontSize', 14);
- % ylabel('[Ca^{2+}], \muM', 'FontSize', 18);
- % title('[Ca^{2+}]_i(t)', 'FontSize', 18);
- % box on;
- % set(gca, 'FontSize', 18);
- %
- % subplot(5, 2, [3 4]);
- % %time_V = time_V';
- % omega_cur = 0;
- % omega_total = [];
- % time_total = [];
- % %yyaxis left;
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %i = 24;
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- %
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- %
- % if isempty([pks, locs]) || size(pks, 1) == 1
- % omega_cur = 0;
- % omega_total = [omega_total omega_cur'];
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % omega_cur = 1./diff(locs);
- % %omega_cur = omega_cur(find(omega_cur'<=60));
- % omega_total = [omega_total omega_cur'];
- % time_locs = locs;
- % time_locs = time_locs(2:end);
- % %time_locs = time_locs(find(omega_cur'<=60));
- % time_total = [time_total time_locs'];
- % %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % %hold on;
- % end
- %
- % if ~isempty([pks, locs]) && size(pks, 1) > 1
- % plot(time_locs, omega_cur, '.-');
- % hold on;
- % end
- % end
- %
- % set(gca, 'FontSize', 18);
- % %grid on;
- % rectangle('Position',[33 0 1 60], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- % rectangle('Position',[37 0 1 60], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- % xlim([24 50]);
- % ylim([0 50]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax.YTick = [0:10:50];
- % %legend('<\nu_i>');
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('\nu, s^{-1}', 'FontSize', 18);
- % title('Neurons frequencies, \nu_i', 'FontSize', 18);
- % box on;
- % time_V = time_V';
- %
- % subplot(5, 2, [5 6]);
- % plot(time_k_syn, k_syn, 'LineWidth', 2);
- % hold on;
- % rectangle('Position',[33 0 1 1.0], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- % rectangle('Position',[37 0 1 1.0], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- % %grid on;
- % xlim([24 50]);
- % ylim([0 1.0]);
- % ax = gca;
- % ax.XTick = [0:2:60];
- % ax = gca;
- % ytickformat('%.1f');
- % set(gca, 'YTick', [0.0 : 0.2 : 1.0]);
- % %ax.YTick = [0:0.25:1.0];
- % xlabel('Time, s', 'FontSize', 18);
- % ylabel('k_{syn}', 'FontSize', 18);
- % title('<k_{syn}>', 'FontSize', 18);
- % box on;
- % set(gca, 'FontSize', 18);
- %
- % subplot(5, 2, 7);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % hold on;
- % rectangle('Position',[33 -80 1 120], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %grid on;
- % xlim([33 34]);
- % ylim([-80 40]);
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [33:0.2:34]);
- % ax.YTick = [-80:40:40];
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('V_i(t)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- %
- % subplot(5, 2, 9);
- % time_V = time_V';
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([33 34]);
- % ylim([0 size(V, 2)+1]);
- % rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % ax = gca;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [33:0.2:34]);
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:100:size(V, 2)];
- % xlabel('Time, s', 'FontSize', 18);
- % ylabel('Neuron #', 'FontSize', 18);
- % title(['Neurons time spikes raster'], 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- %
- % subplot(5, 2, 8);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 18);
- % %grid on;
- % xlim([37 38]);
- % ylim([-80 40]);
- % ax = gca;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [37:0.2:38]);
- % ax.YTick = [-80:40:40];
- % rectangle('Position',[37, -80, 1, 120], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('V_i(t)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- %
- % subplot(5, 2, 10);
- % regular_V_spiking_counter = 0;
- % for i = 1:size(V, 2)
- % %V_p = V(:, 1);
- % V_p = V(:, i);
- % [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- % if ~isempty([pks, locs])
- % regular_V_spiking_counter = regular_V_spiking_counter + 1;
- % end
- % for pks_counter = 1:size(pks, 1)
- % pks(pks_counter) = i;
- % end
- % plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- % hold on;
- %
- % N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- % end
- %
- % xlim([37 38]);
- % ylim([0 size(V, 2)+1]);
- % rectangle('Position',[37, 0, 1, 201], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [37:0.2:38]);
- % %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- % ax.YTick = [0:100:size(V, 2)];
- % xlabel('Time, s', 'FontSize', 18);
- % ylabel('Neuron #', 'FontSize', 18);
- % title(['Neurons time spikes raster'], 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- %
- % saveas(gcf, 'results_presentation_raster_Ca_V_all.png');
- % saveas(gcf, 'results_presentation_raster_Ca_V_all', 'epsc');
- % %savefig(results_paper_raster_Ca_V_all, 'results_paper_raster_Ca_V_all.fig')
- % close(results_presentation_raster_Ca_V_all);
- % %clear;
- % disp('results_presentation_raster_Ca_V_all save');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %m08
- results_paper_raster_Ca_V_all_A_m08 = figure('units', 'normalized', 'outerposition', [0 0 0.53 1], 'visible', 'on');
- subplot(4, 2, [1 2]);
- line([0, 60], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- hold on;
- plot(time_Ca, Ca_m08(:, :), 'LineWidth', 1);
- hold on;
- rectangle('Position',[33 0 1 0.7], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 0.7], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([24 50]);
- ylim([0 0.7]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 0.7]);
- %xlabel('Time, sec', 'FontSize', 14);
- ylabel('[Ca^{2+}], \muM', 'FontSize', 20);
- title('a)', 'FontSize', 20);
- box on;
- set(gca, 'FontSize', 20);
- subplot(4, 2, [3 4]);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %i = 24;
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '.-');
- hold on;
- end
- end
- set(gca, 'FontSize', 20);
- %grid on;
- rectangle('Position',[33 0 1 60], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 60], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- xlim([24 50]);
- ylim([0 50]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax.YTick = [0:10:50];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', 20);
- ylabel('\nu, s^{-1}', 'FontSize', 20);
- title('b)', 'FontSize', 20);
- box on;
- %time_V = time_V';
- subplot(4, 2, [5 6]);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- plot(time_k_syn, k_syn_m08, 'LineWidth', 2);
- hold on;
- rectangle('Position',[33 0 1 1.0], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 1.0], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([24 50]);
- ylim([0 1.0]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 1.0]);
- %ax.YTick = [0:0.25:1.0];
- xlabel('Time, s', 'FontSize', 20);
- ylabel('k', 'FontSize', 20);
- title('c)', 'FontSize', 20);
- box on;
- set(gca, 'FontSize', 20);
- % subplot(4, 2, 7);
- % plot(time_V, V_m08(:, :), 'LineWidth', 1);
- % hold on;
- % rectangle('Position',[33 -80 1 120], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %grid on;
- % xlim([33 34]);
- % ylim([-80 40]);
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [33:0.2:34]);
- % ax.YTick = [-80:40:40];
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('d)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- subplot(4, 2, 7);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %V_p = V(:, 1);
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([33 34]);
- ylim([0 size(V_m08, 2)+1]);
- rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [33:0.2:34]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_m08, 2)];
- xlabel('Time, s', 'FontSize', 20);
- ylabel('Neuron #', 'FontSize', 20);
- title(['d)'], 'FontSize', 20);
- set(gca, 'FontSize', 20);
- % subplot(4, 2, 8);
- % plot(time_V, V_m08(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 18);
- % %grid on;
- % xlim([37 38]);
- % ylim([-80 40]);
- % ax = gca;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [37:0.2:38]);
- % ax.YTick = [-80:40:40];
- % rectangle('Position',[37, -80, 1, 120], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('e)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- subplot(4, 2, 8);
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %V_p = V(:, 1);
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([37 38]);
- ylim([0 size(V_m08, 2)+1]);
- rectangle('Position',[37, 0, 1, 201], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [37:0.2:38]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_m08, 2)];
- xlabel('Time, s', 'FontSize', 20);
- %ylabel('Neuron #', 'FontSize', 20);
- title(['e)'], 'FontSize', 20);
- set(gca, 'FontSize', 20);
- saveas(gcf, 'results_paper_raster_Ca_V_all_A_m08.png');
- saveas(gcf, 'results_paper_raster_Ca_V_all_A_m08', 'epsc');
- %savefig(results_paper_raster_Ca_V_all, 'results_paper_raster_Ca_V_all.fig')
- close(results_paper_raster_Ca_V_all_A_m08);
- %clear;
- disp('results_paper_raster_Ca_V_all_A_m08 save');
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %10
- results_paper_raster_Ca_V_all_A_10 = figure('units', 'normalized', 'outerposition', [0 0 0.53 1], 'visible', 'on');
- subplot(4, 2, [1 2]);
- line([0, 60], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- hold on;
- plot(time_Ca, Ca_10(:, :), 'LineWidth', 1);
- hold on;
- rectangle('Position',[33 0 1 0.7], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 0.7], 'FaceColor', [1.0 0.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([24 50]);
- ylim([0 0.7]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 0.7]);
- %xlabel('Time, sec', 'FontSize', 20);
- ylabel('[Ca^{2+}], \muM', 'FontSize', 20);
- title('a)', 'FontSize', 20);
- box on;
- set(gca, 'FontSize', 20);
- subplot(4, 2, [3 4]);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_10_spiking_counter = 0;
- for i = 1:size(V_10, 2)
- %i = 24;
- V_p = V_10(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_10_spiking_counter = regular_V_10_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '.-');
- hold on;
- end
- end
- set(gca, 'FontSize', 20);
- %grid on;
- rectangle('Position',[33 0 1 60], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 60], 'FaceColor', [1.0 0.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- xlim([24 50]);
- ylim([0 50]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax.YTick = [0:10:50];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', 20);
- ylabel('\nu, s^{-1}', 'FontSize', 20);
- title('b)', 'FontSize', 20);
- box on;
- %time_V = time_V';
- subplot(4, 2, [5 6]);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- plot(time_k_syn, k_syn_10, 'LineWidth', 2);
- hold on;
- rectangle('Position',[33 0 1 1.0], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 1.0], 'FaceColor', [1.0 0.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([24 50]);
- ylim([0 1.0]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 1.0]);
- %ax.YTick = [0:0.25:1.0];
- xlabel('Time, s', 'FontSize', 20);
- ylabel('k', 'FontSize', 20);
- title('c)', 'FontSize', 20);
- box on;
- set(gca, 'FontSize', 20);
- % subplot(4, 2, 7);
- % plot(time_V, V_m08(:, :), 'LineWidth', 1);
- % hold on;
- % rectangle('Position',[33 -80 1 120], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %grid on;
- % xlim([33 34]);
- % ylim([-80 40]);
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [33:0.2:34]);
- % ax.YTick = [-80:40:40];
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('d)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- subplot(4, 2, 7);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_10_spiking_counter = 0;
- for i = 1:size(V_10, 2)
- %V_p = V(:, 1);
- V_p = V_10(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_10_spiking_counter = regular_V_10_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([33 34]);
- ylim([0 size(V_10, 2)+1]);
- rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [33:0.2:34]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_10, 2)];
- xlabel('Time, s', 'FontSize', 20);
- ylabel('Neuron #', 'FontSize', 20);
- title(['d)'], 'FontSize', 20);
- set(gca, 'FontSize', 20);
- % subplot(4, 2, 8);
- % plot(time_V, V_m08(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 18);
- % %grid on;
- % xlim([37 38]);
- % ylim([-80 40]);
- % ax = gca;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [37:0.2:38]);
- % ax.YTick = [-80:40:40];
- % rectangle('Position',[37, -80, 1, 120], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('e)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- subplot(4, 2, 8);
- regular_V_10_spiking_counter = 0;
- for i = 1:size(V_10, 2)
- %V_p = V(:, 1);
- V_p = V_10(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_10_spiking_counter = regular_V_10_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([37 38]);
- ylim([0 size(V_10, 2)+1]);
- rectangle('Position',[37, 0, 1, 201], 'EdgeColor', '[1.0 0.0 1.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [37:0.2:38]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_10, 2)];
- xlabel('Time, s', 'FontSize', 20);
- %ylabel('Neuron #', 'FontSize', 20);
- title(['e)'], 'FontSize', 20);
- set(gca, 'FontSize', 20);
- saveas(gcf, 'results_paper_raster_Ca_V_all_A_10.png');
- saveas(gcf, 'results_paper_raster_Ca_V_all_A_10', 'epsc');
- %savefig(results_paper_raster_Ca_V_all, 'results_paper_raster_Ca_V_all.fig')
- close(results_paper_raster_Ca_V_all_A_10);
- %clear;
- disp('results_paper_raster_Ca_V_all_A_10 save');
- return
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- results_paper_raster_V_g_astro_A = figure('units', 'normalized', 'outerposition', [0 0 0.55 1], 'visible', 'on');
- subplot(4, 3, [1 2 3]);
- line([0, 60], [0.3, 0.3], 'Color', 'red', 'LineStyle', '--', 'LineWidth', 1);
- hold on;
- plot(time_Ca, Ca_m08(:, :), 'LineWidth', 1);
- hold on;
- rectangle('Position',[33 0 1 0.7], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[37 0 1 0.7], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- rectangle('Position',[46 0 1 0.7], 'FaceColor', [1.0 0.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([24 50]);
- ylim([0 0.7]);
- ax = gca;
- ax.XTick = [0:2:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 0.7]);
- %xlabel('Time, sec', 'FontSize', 14);
- ylabel('[Ca^{2+}], \muM', 'FontSize', 18);
- title('a)', 'FontSize', 18);
- box on;
- set(gca, 'FontSize', 18);
- subplot(4, 3, 4);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- %time_V = time_V';
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %i = 24;
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '.-');
- hold on;
- end
- end
- set(gca, 'FontSize', 18);
- %grid on;
- rectangle('Position',[33 0 1 60], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- % rectangle('Position',[37 0 1 60], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- xlim([30 35]);
- ylim([0 50]);
- ax = gca;
- ax.XTick = [0:1:60];
- ax.YTick = [0:10:50];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', 12);
- ylabel('\nu, s^{-1}', 'FontSize', 18);
- title('b)', 'FontSize', 18);
- box on;
- %time_V = time_V';
- subplot(4, 3, 5);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- %time_V = time_V';
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %i = 24;
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '.-');
- hold on;
- end
- end
- set(gca, 'FontSize', 18);
- %grid on;
- % rectangle('Position',[33 0 1 60], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- rectangle('Position',[37 0 1 60], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- xlim([35 40]);
- ylim([0 50]);
- ax = gca;
- ax.XTick = [0:1:60];
- ax.YTick = [0:10:50];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', 12);
- %ylabel('\nu, s^{-1}', 'FontSize', 18);
- title('c)', 'FontSize', 18);
- box on;
- %time_V = time_V';
- subplot(4, 3, 6);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- %time_V = time_V';
- omega_cur = 0;
- omega_total = [];
- time_total = [];
- %yyaxis left;
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_10, 2)
- %i = 24;
- V_p = V_10(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- if isempty([pks, locs]) || size(pks, 1) == 1
- omega_cur = 0;
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, i, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- omega_cur = 1./diff(locs);
- %omega_cur = omega_cur(find(omega_cur'<=60));
- omega_total = [omega_total omega_cur'];
- time_locs = locs;
- time_locs = time_locs(2:end);
- %time_locs = time_locs(find(omega_cur'<=60));
- time_total = [time_total time_locs'];
- %plot(omega_cur, pks(2:end), 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- %hold on;
- end
- if ~isempty([pks, locs]) && size(pks, 1) > 1
- plot(time_locs, omega_cur, '.-');
- hold on;
- end
- end
- set(gca, 'FontSize', 18);
- %grid on;
- % rectangle('Position',[33 0 1 60], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- % hold on;
- rectangle('Position',[46 0 1 60], 'FaceColor', [1.0 0.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- xlim([44 49]);
- ylim([0 50]);
- ax = gca;
- ax.XTick = [0:1:60];
- ax.YTick = [0:10:50];
- %legend('<\nu_i>');
- %xlabel('Time, sec', 'FontSize', 12);
- %ylabel('\nu, s^{-1}', 'FontSize', 18);
- title('d)', 'FontSize', 18);
- box on;
- %time_V = time_V';
- subplot(4, 3, 7);
- plot(time_k_syn, k_syn_m08, 'LineWidth', 2);
- hold on;
- rectangle('Position',[33 0 1 1.0], 'FaceColor', [0.0 1.0 0.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([30 35]);
- ylim([0 1.0]);
- ax = gca;
- ax.XTick = [0:1:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 1.0]);
- %ax.YTick = [0:0.25:1.0];
- %xlabel('Time, s', 'FontSize', 18);
- ylabel('k', 'FontSize', 18);
- title('e)', 'FontSize', 18);
- box on;
- set(gca, 'FontSize', 18);
- subplot(4, 3, 8);
- plot(time_k_syn, k_syn_m08, 'LineWidth', 2);
- hold on;
- rectangle('Position',[37 0 1 1.0], 'FaceColor', [0.0 1.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([35 40]);
- ylim([0 1.0]);
- ax = gca;
- ax.XTick = [0:1:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 1.0]);
- %ax.YTick = [0:0.25:1.0];
- %xlabel('Time, s', 'FontSize', 18);
- %ylabel('k', 'FontSize', 18);
- title('f)', 'FontSize', 18);
- box on;
- set(gca, 'FontSize', 18);
- subplot(4, 3, 9);
- plot(time_k_syn, k_syn_10, 'LineWidth', 2);
- hold on;
- rectangle('Position',[46 0 1 1.0], 'FaceColor', [1.0 0.0 1.0 0.2], 'EdgeColor', 'none', 'LineStyle', 'none');
- hold on;
- %grid on;
- xlim([44 49]);
- ylim([0 1.0]);
- ax = gca;
- ax.XTick = [0:1:60];
- ax = gca;
- ytickformat('%.1f');
- set(gca, 'YTick', [0.0 : 0.2 : 1.0]);
- %ax.YTick = [0:0.25:1.0];
- %xlabel('Time, s', 'FontSize', 18);
- %ylabel('k', 'FontSize', 18);
- title('g)', 'FontSize', 18);
- box on;
- set(gca, 'FontSize', 18);
- subplot(4, 3, 10);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %V_p = V(:, 1);
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([33 34]);
- ylim([0 size(V_m08, 2)+1]);
- rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [33:0.5:34]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_m08, 2)];
- xlabel('Time, s', 'FontSize', 18);
- ylabel('Neuron #', 'FontSize', 18);
- title(['h)'], 'FontSize', 18);
- set(gca, 'FontSize', 18);
- subplot(4, 3, 11);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %V_p = V(:, 1);
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([37 38]);
- ylim([0 size(V_m08, 2)+1]);
- rectangle('Position',[37, 0, 1, 201], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [37:0.5:38]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_m08, 2)];
- xlabel('Time, s', 'FontSize', 18);
- %ylabel('Neuron #', 'FontSize', 18);
- title(['i)'], 'FontSize', 18);
- set(gca, 'FontSize', 18);
- subplot(4, 3, 12);
- if (size(time_V, 2) > size(time_V, 1))
- time_V = time_V';
- end
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_10, 2)
- %V_p = V(:, 1);
- V_p = V_10(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- %N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([46 47]);
- ylim([0 size(V_10, 2)+1]);
- rectangle('Position',[46, 0, 1, 201], 'EdgeColor', '[1.0 0.0 1.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [46:0.5:47]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_10, 2)];
- xlabel('Time, s', 'FontSize', 18);
- %ylabel('Neuron #', 'FontSize', 18);
- title(['j)'], 'FontSize', 18);
- set(gca, 'FontSize', 18);
- saveas(gcf, 'results_paper_raster_V_g_astro_A.png');
- saveas(gcf, 'results_paper_raster_V_g_astro_A', 'epsc');
- %savefig(results_paper_raster_Ca_V_all, 'results_paper_raster_Ca_V_all.fig')
- close(results_paper_raster_V_g_astro_A);
- %clear;
- disp('results_paper_raster_V_g_astro_A save');
- return
- % subplot(5, 2, 7);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % hold on;
- % rectangle('Position',[33 -80 1 120], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %grid on;
- % xlim([33 34]);
- % ylim([-80 40]);
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [33:0.2:34]);
- % ax.YTick = [-80:40:40];
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('d)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- subplot(4, 2, 7);
- time_V = time_V';
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %V_p = V(:, 1);
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([33 34]);
- ylim([0 size(V_m08, 2)+1]);
- rectangle('Position',[33, 0, 1, 201], 'EdgeColor', '[0.0 1.0 0.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [33:0.2:34]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_m08, 2)];
- xlabel('Time, s', 'FontSize', 18);
- ylabel('Neuron #', 'FontSize', 18);
- title(['f)'], 'FontSize', 18);
- set(gca, 'FontSize', 18);
- % subplot(5, 2, 8);
- % plot(time_V, V(:, :), 'LineWidth', 1);
- % set(gca, 'FontSize', 18);
- % %grid on;
- % xlim([37 38]);
- % ylim([-80 40]);
- % ax = gca;
- % ax = gca;
- % xtickformat('%.1f');
- % set(gca, 'XTick', [37:0.2:38]);
- % ax.YTick = [-80:40:40];
- % rectangle('Position',[37, -80, 1, 120], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- % hold on;
- % box on;
- % %xlabel('Time, sec', 'FontSize', 12);
- % ylabel('V, mV', 'FontSize', 18);
- % title('e)', 'FontSize', 18);
- % set(gca, 'FontSize', 18);
- subplot(4, 2, 8);
- regular_V_m08_spiking_counter = 0;
- for i = 1:size(V_m08, 2)
- %V_p = V(:, 1);
- V_p = V_m08(:, i);
- [pks, locs] = findpeaks(V_p, time_V, 'MinPeakHeight', -10, 'MinPeakDistance', 0.001);
- if ~isempty([pks, locs])
- regular_V_m08_spiking_counter = regular_V_m08_spiking_counter + 1;
- end
- for pks_counter = 1:size(pks, 1)
- pks(pks_counter) = i;
- end
- plot(locs, pks, 'd', 'MarkerSize', 2, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k');
- hold on;
- N_time_V_array(i, ismember(round(time_V*1e5), round(locs*1e5))) = 1;
- end
- xlim([37 38]);
- ylim([0 size(V_m08, 2)+1]);
- rectangle('Position',[37, 0, 1, 201], 'EdgeColor', '[0.0 1.0 1.0 0.5]', 'LineWidth', 3);
- hold on;
- box on;
- ax = gca;
- xtickformat('%.1f');
- set(gca, 'XTick', [37:0.2:38]);
- %ax.YTick = [0:sqrt(size(V, 2)):size(V, 2)];
- ax.YTick = [0:100:size(V_m08, 2)];
- xlabel('Time, s', 'FontSize', 18);
- ylabel('Neuron #', 'FontSize', 18);
- title(['g)'], 'FontSize', 18);
- set(gca, 'FontSize', 18);
- saveas(gcf, 'results_paper_raster_Ca_V_all.png');
- saveas(gcf, 'results_paper_raster_Ca_V_all', 'epsc');
- %savefig(results_paper_raster_Ca_V_all, 'results_paper_raster_Ca_V_all.fig')
- close(results_paper_raster_Ca_V_all_m08);
- %clear;
- disp('results_paper_raster_Ca_V_all save');
- %%%%%%%
- clear all;
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement