function PlotSolution(u,N,T);
% PLOTSOLUTION plots a solution given on a triangular mesh
%   PlotSolution(u,N,T); plots the solution vector u on the mesh
%   given by nodes N and triangles T also coding u using color.
%   Note that often view([0 90]) then gives a good 2d color contour plot.

X = [(N(T(:,1),1))';(N(T(:,2),1))';(N(T(:,3),1))'];  % for speed
Y = [(N(T(:,1),2))';(N(T(:,2),2))';(N(T(:,3),2))'];
Z = [(u(T(:,1)))';(u(T(:,2)))';(u(T(:,3)))'];
if size(T,1) > 100,
    patch(X,Y,Z,Z,'LineStyle','none');  
  else
    patch(X,Y,Z,Z);
  end
colorbar;
