. .
Understanding first spike latency - current relationship



Click here for general introduction to the simulator.

In this exercise we mainly focuses two objectives 1) how the intensity of input current modulates the fist spike latency 2) to understand the importance of current clamp technique in understanding the behavior of electrically excitable cells like neurons.

Step 1 : Load simulator by clicking on the icon "Simulator" on top panel.

Step 2 : Click on " Stimuli" tab under "Variables" sub window and then click on " Stim1" button to get the user friendly flexible interface to set amplitude, delay and duration of input current.

Fig. 1 User friendly interface to set input stimuli

Step 3 : Basically the user has to click on the brown spot which is on the Stim1 / Stim2 interface (see Fig 1) plot to adjust the amplitude, delay and duration of input current.

Step 4 : Click on "RUN" button of simulation control tab to start the simulation, then click on "Stim1" button to apply Stim1 as stimulus to HH neuron. Or one can directlyclick on "Stim1" button of simulation control tab to apply Stim1 and start the simulation.

Fig 2. Run control

This will simulate HH neuron model for given stimuli as current.

Step 5: First spike latency can be estimated from exported file (see Fig 3).


Fig 3. Measuring first spike latency from exported file

Repeate the same procedure (step 1-5) by  changing the step input current 1 nA - 20 nA  with an increment of 1 nA at step 3 . In each case the number of spikes, first spike latency has to be recorded. Then finally plots the Current-vs-First spike latency graph (first spike latency on y-axis and injected current on x-axis) (see Fig.2,3 of theory). We have used Matlab to plot the graphs. Users can use Matlab / GNU Octave / Microsoft office.


Procedure for plotting Latency Vs Current graph using Matlab / GNU Octave


Make sure that Matlab is installed in your machine (find matlab installation folder in windows C:Program FilesMATLAB , For Linux users type 'matlab/octave' on terminal)


  1. Double click on Matlab icon on the desktop (for linux type matlab / octave on terminal), this will load matlab / octave.
  2. Create a new matlab script file from File-> New -> Script / Open a text editor
  3. Matlab / Octave uses '%' for commenting a line, use '%' to give appropriate title for your script.
  4. Assign input stimulus to a row vector called 'stimulus'. for example "stimulus = [3,6,9,12,15,18,21];"
  5. Assign first spike latency  to a row vector called 'latency'. for example "latency = [8.4,7.6,7.3,7.1,6.9,6.7,6.7];"
  6. And finally plot the Latency-vs-Current graph (first spike latency on y-axis and injected current on x-axis).Use star symbol  '*' for highlighting the data points. for example "plot(stimulus,latency,'*');"
  7. Add label for x and y axis. for example  " xlabel('Current (nA)');" "ylabel('First spike latency');"
  8. Save the script as 'L-vs-I_plot.m', then run the script by clicking run button at top panel of the matlab file editor or press 'F5' button of your key board, for octave type the file name on the octave terminal from the same directory where the file is saved.
  9. Matlab / Octave may ask you to change the path for execution , please click on change path.
  10. The plot that you are seeing at your monitor is Latency-vs-I plot (like Fig.2 of theory).



Procedure for plotting Latency Vs Current graph using Microsoft Excel / Open Office


Make sure that Microsoft Excel is installed in your machine (find Microsoft excel installation folder in windows C:Program FilesMicrosoft Office , For Linux users Open Office)


  1. Double click on Microsoft excel icon on the desktop or Start-> All Programs -> Microsoft office -> Microsoft excel , this will load Microsoft excel in your computer.
  2. Enter Injected Current (nA) and number of spikes as table format (like Table 1 of theory ) to the excel sheet.
  3. Select the table values of both the colum (excluding label).
  4. Go to Insert-> Charts -> Line -> 2D line (select the format you wanted to plot).
  5. The plot that you are seeing at your monitor is Latency-vs-Current plot (will look like Fig 2 of theory).


 Neuron Simulator is based on David S. Touretzky's Hodgkin-Huxley Simulator.





                    Unfortunately, this Virtual Lab requires Adobe Flash player.  Please see additional information if this does not work on your computer

• For Google Chrome - https://support.google.com/chrome/answer/6258784?co=GENIE.Platform%3DDesktop&hl=en

• For Microsoft Edge - https://support.microsoft.com/en-in/help/4532571/microsoft-edge-turn-on-flash 

• For Mozilla Firefox - https://support.mozilla.org/en-US/kb/install-flash-plugin-view-videos-animations-games


On GNU/Linux machines, please see appropriate online help. For example, 


• on Ubuntu - https://help.ubuntu.com/stable/ubuntu-help/net-install-flash.html.en 

• on Fedora - https://docs.fedoraproject.org/en-US/quick-docs/using-adobe-flash/




Cite this Simulator:

..... .....

Copyright @ 2024 Under the NME ICT initiative of MHRD

 Powered by AmritaVirtual Lab Collaborative Platform [ Ver 00.13. ]