This is the matlab code associated with the paper: Balachandar A, Prescott SA (2018) Origin of heterogeneous spiking patterns from continuously distributed ion channel densities: a computational study in spinal dorsal horn neurons. J Physiol 596:1681-1697 This is the authors original code downloaded from the authors web site: http://prescottlab.ca/code-for-models on 20190510.