(*
   single.m
	load information to prepare for single-column response plots
		(use before select.m)
*)

input = "q120"     (*  input file  *)
numberunits = 30   (*  number of columns *)
len = 40           (*  maximum number of trials to display  *)

normaliz[lis_] :=
	Block[{min = Min[lis],
		max = Max[lis],
		range = max - min,
		new = {},
		current = lis},
	
		While[current != {},
			{
				new = Append[new, (First[current] - min)/range];
				current = Rest[current];
			}
			]
		Print[new];
		Return[new];
		]


sele[inp_, elem_] :=
	Block[{new = {}, current = inp},
		While[current != {},
			{
				new = Append[new, First[current][[elem]]];
				current = Rest[current];
			}
			]
		Print[new];
		Return[new];
		]

raw0 = ReadList[StringJoin["!grep p0 ", input, ".out | head -", ToString[len],
	" | fil ", ToString[numberunits + 5], " 5"],
	Table[Number, {numberunits}]]
raw1 = ReadList[StringJoin["!grep p1 ", input, ".out | head -", ToString[len],
	" | fil ", ToString[numberunits + 5], " 5"],
	Table[Number, {numberunits}]]
raw2 = ReadList[StringJoin["!grep p2 ", input, ".out | head -", ToString[len],
	" | fil ", ToString[numberunits + 5], " 5"],
	Table[Number, {numberunits}]]
raw3 = ReadList[StringJoin["!grep p3 ", input, ".out | head -", ToString[len],
	" | fil ", ToString[numberunits + 5], " 5"],
	Table[Number, {numberunits}]]



