%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function plot_mat(e_mat,ndof)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plot mesh 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(1)   
clf

[nel,ned]=size(e_mat);
indx=[1:2:ned]; ex_mat=e_mat(:,indx);
indx=[2:2:ned]; ey_mat=e_mat(:,indx);

s1='-';
s1=[s1,'k'];
s2='ko';
 
x=ex_mat'; 
y=ey_mat';
xc=[x; x(1,:)];
yc=[y; y(1,:)]; 

axis('equal')
axis off

hold on
plot(xc,yc,s1) 

xmin = min(min(ex_mat(:,:)))-0.01;
ymin = min(min(ey_mat(:,:)))-0.01;
xmax = max(max(ex_mat(:,:)))+0.01;
ymax = max(max(ey_mat(:,:)))+0.01;

axis([xmin, xmax, ymin, ymax]);

%print('-dtiff', '-r100', ...
%      ['plot_', num2str(is,['%',num2str(5),'.',num2str(5),'d'])])
hold off 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
