// find_averages.hoc // To create concentration dependent graph: // I want to graph the average voltages in the dendrites // (do I want to break it up into the obliques, primary, tuft)? // graph the averages in bins of 50 microns to get started objref bin_vecx, bin_vecy, bin_vecca objref tmp_vecy, bin_std, bin_stderr objref tmp_vecca, bin_stdca, bin_stderrca tmp_vecy = new Vector() tmp_vecca = new Vector() bin_vecx = new Vector() bin_vecy = new Vector() bin_std = new Vector() bin_stderr = new Vector() bin_stdca = new Vector() bin_stderrca = new Vector() interval=50 // 50 um bin size proc graph_avg() { // pass the graph object as \$o1, the ca graph object as \$o2, color as \$3 // global vectors distrx contains the distance from the soma, distry the voltages, distrca max calcium // reset vectors bin_vecy=new Vector() bin_vecca=new Vector() bin_vecx=new Vector() bin_std=new Vector() bin_stderr=new Vector() bin_stdca=new Vector() bin_stderrca=new Vector() // xv is x value // for (xv=0;xv<850;xv += interval) { for j=0, distrx.size()-1 { xv=distrx.x[j]-interval/2 // start of bin interval under consideration bin_vecx.append(distrx.x[j]) // each point on apical dendrites is a bin center tmp_vecy = new Vector() // first store all the y values for a bin here // then calculate the statistics on them tmp_vecca = new Vector() // first store all the calcium values for a bin here // then calculate the statistics on them // iterate over distrx, distry the distributions over the apical dends. for i=0, distrx.size()-1 { dist = distrx.x[i] if ((dist>=xv)&& (dist