How to voltage clamp a neuron?

I want to sweep the membrane potential and check that the plasticity rule does what it’s supposed to do. On second thought it’s Plotting of arbitrary functions - #2 by mstimberg again, but it’s somehow not so nice that I cannot test against my “full model”. It would be good if I don’t have to replace the neuron dynamics equations.