Here is a skeleton of one possible implementation of the final procedure.
Ordinary comments are indicated by //,
things that remain to be done are indicated
by remarks inside /* */ pairs.

// objects must first be declared _outside_ procedures
objref location, amplitude	// to store results
location = new Vector()
amplitude = new Vector()

objref vm	// for temporary storage of somatic vm
vm = new Vector()
/* use Vector class .record() to "attach" vm to soma.v(0.5) */

objref g	// for plot of amplitude vs. location
g = new Graph()

proc profile() {
	// next three statements discard prior results, if any
	location = new Vector()
	amplitude = new Vector()
	g = new Graph()
	dend for (x) {	// loop over each node in dend
		putsyn()
		// at this point, vm should contain a record of soma.v(0.5) 
		/* find maximum element in vm */
		/* append this to amplitude vector */
		/* append x to location vector */
	}
	/* plot amplitude vs. location */
}


NEURON summer course
Copyright © 1998, 1999 by N.T. Carnevale and M.L. Hines, all rights reserved.