function [p,t] = fix_mesh(p,t)
%
%     [p,t]   = FIX_MESH(p,t)       returns a node matrix and a triangle
%                                   matrix such that they can be input 
%                                   to the "triangular_to_rectangular()"
%                                   and "rectangular_to_triangular()"
%                                   functions
%     Description: This fucntion essentially transposes the node and
%     triangle matrices that exported from PDETOOL. Further, it strips
%     the last column of the triangle matrix
%
%    Input  :  p  --> node matrix exported from PDETOOL      (2 X N_nodes)
%              t  --> triangle matrix exported from PDETOOL  (4 X N_tri)
%
%    Output :  p  --> node matrix                            (N_nodes X 2)
%              t  --> triangle                               (N_tri X 3)
%    
%
  
  p = p';
  t = t';
  t = t(:,1:3);
  
  