%-------------------------------------------------------------------------------
% This program will take the file called 'data' gotten from the simulation run
% and produce a surface plot of the potentials along with the position of the
% cells shown along the surface.
%-------------------------------------------------------------------------------

a = load('data');
for i = 1:40
  for j = 1:40
    b(41-i,j) = a(((j-1)*40+i), 3);
  end
end
surf(b);
xlabel('x');
ylabel('y');
zlabel('potential');

% hold graph to place all cells
hold

% the next line in 'a' (1601) has the data for how many cells
% need to be depicted
cellnum = a(1601, 3);
 
% place cells by using plot3(x,y,val,'k*') where x,y are
% the indeces of the location and val is a constant location.  
for i = 1:cellnum
  x = a(1601+i,1)+1;
  y = 39-a(1601+i,2)+1;
  plot3(x,y,b(y,x),'mh');
end

% release graph
hold
