//objref membraneEExtracellular[1] //e_extracellular
//membraneEExtracellular[0] = new Vector()
//membraneEExtracellular[0].record(&node[101].e_extracellular(0.5))








proc membraneVoltageTofile1() {local i, j  localobj tfil

  print "writing to ", $s1
  tfil = new File()
  tfil.wopen($s1)

  for i=0,membraneTimes.size()-1 {

	tfil.printf("%g\t", membraneTimes.x[i]) //first print the time at i
	tfil.printf("%g\t", membraneEExtracellular[0].x[i])  //e_extracellular

	tfil.printf("%g\t", membraneVoltageNode[103].x[i])
	tfil.printf("%g\t", membraneVoltageNode[98].x[i])
	tfil.printf("%g\t", membraneVoltageNode[42].x[i])
	tfil.printf("%g\n", membraneVoltageNode[45].x[i])  //Add a new line at the end


	}
  tfil.close()
}
membraneVoltageTofile1("membraneVoltages/figure2.txt")