Index: issm/trunk/src/m/utils/Exp/expdoc.m
===================================================================
--- issm/trunk/src/m/utils/Exp/expdoc.m	(revision 2605)
+++ issm/trunk/src/m/utils/Exp/expdoc.m	(revision 2607)
@@ -33,6 +33,4 @@
 disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
 disp('            usage: expselect(newfile,oldfile)');
-disp('     expwriteasvertices: writes an Argus file from a structure given in input???');
-disp('            usage: expwriteasvertices(structure,filename)');
 disp('     expwrite: writes an Argus file from a structure given in input???');
 disp('            usage: expwrite(structure,filename)');
Index: issm/trunk/src/m/utils/Exp/readwrite/expread.m
===================================================================
--- issm/trunk/src/m/utils/Exp/readwrite/expread.m	(revision 2605)
+++ issm/trunk/src/m/utils/Exp/readwrite/expread.m	(revision 2607)
@@ -1,7 +1,7 @@
-function struct=expread(name,whole);
-%EXPREAD - read a file exp and build a structure
+function Struct=expread(filename,whole);
+%EXPREAD - read a file exp and build a Structure
 %
-%   This routine reads a file .exp and build a structure containing the 
-%   fields x and y corresponding to the coordinates, one for the name of
+%   This routine reads a file .exp and build a Structure containing the 
+%   fields x and y corresponding to the coordinates, one for the filename of
 %   the exp file, for the density, for the nodes, and a field closed to 
 %   indicate if the domain is closed. 
@@ -10,54 +10,72 @@
 %
 %   Usage:
-%      struct=expread(name,whole)
+%      Struct=expread(filename,whole)
 %  
 %   Example:
-%      struct=expread('domainoutline.exp',1)
+%      Struct=expread('domainoutline.exp',1)
 %
 %   See also EXPDOC, EXPWRITEASVERTICES
 
 %some checks
-if ~exist(name),
-	error(['expread error message: file ' name ' not found!']);
+if ~exist(filename),
+	error(['expread error message: file ' filename ' not found!']);
+end
+if nargin~=2,
+	help expread
+	error('expread error message: second argument not provided'),
 end
 
-try,
-fid=fopen(name,'r');
-i=0;
+%initialize number of profile
+count=0;
+
+%open file
+fid=fopen(filename,'r');
+
+%loop over the number of profiles
 while (~feof(fid)),
-   i=i+1;
-   %firt line contains the name
-   A=readline(fid,2);
-   if length(A)>8, 
-       struct(i).name=A(9:length(A));
+
+	%update number of profiles
+   count=count+1;
+
+   %Get file name
+	A=fscanf(fid,'%s %s',2);
+	if ~strncmp(A,'##Name:',7), break; end
+	if length(A)>7, 
+		Struct(count).name=A(8:end);
+	else
+		Struct(count).name='';
+	end
+
+	%Get Icon
+	A=fscanf(fid,'%s %s',2);
+	if ~strncmp(A,'##Icon:',6), break; end
+
+	%Get Info
+	A=fscanf(fid,'%s %s %s %s',4);
+	if ~strncmp(A,'#Points',7), break; end
+
+	%Get number of nods and density
+   A=fscanf(fid,'%f %f',[1 2]);
+   if whole==1,
+       Struct(count).nods=A(1);
+   else
+       Struct(count).nods=A(1)-1;
    end
+   Struct(count).density=A(2);
 
-   A=readline(fid,2);
-   A=readline(fid,4);
+	%Get Info
+	A=fscanf(fid,'%s %s %s %s',5);
+	if ~strncmp(A,'#XposYpos',9), break; end
 
-   [A,bytecount]=fscanf(fid,'%f %f',[1 2]);
-   if whole==1,
-       struct(i).nods=A(1);
-   else
-       struct(i).nods=A(1)-1;
-   end
-   struct(i).density=A(2);
-   A=readline(fid,5);
+	%Get Coordinates
+	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
+	Struct(count).x=A(1,:)';
+	Struct(count).y=A(2,:)';
 
-   struct(i).x=zeros(struct(i).nods,1);
-   struct(i).y=zeros(struct(i).nods,1);
-   struct(i).closed=0;
-
-   for n=1:struct(i).nods,
-       [A,bytecount]=fscanf(fid,'%f %f',[1 2]);
-       struct(i).x(n)=A(1);
-       struct(i).y(n)=A(2);
-   end
-   if whole==0,
-       fscanf(fid,'%f %f',[1 2]);
-   end
+	%skip last coordinate if whole=0,
+   if whole==0, fscanf(fid,'%f %f',[1 2]); end
 
 end
-catch,
-end
+
+%close file
 fclose(fid);
Index: issm/trunk/src/m/utils/Exp/readwrite/expwriteasvertices.m
===================================================================
--- issm/trunk/src/m/utils/Exp/readwrite/expwriteasvertices.m	(revision 2605)
+++ 	(revision )
@@ -1,25 +1,0 @@
-function expwriteasvertices(a,filename);
-%EXPWRITEASVERTIVES - write an Argus file from a structure given in input
-%
-%   This routine write an Argus file form a structure containing the fields:
-%   x and y of the coordinates of the points.
-%   The first argument is the structure containing the points coordinates 
-%   and the second one the file to be write.
-%
-%   Usage:
-%      expwriteasvertices(a,filename)
-% 
-%   Example:
-%      expwriteasvertices(coordstruct,'domainoutline.exp')
-%
-%   See also EXPDOC, EXPREAD, EXPWRITE
-
-fid=fopen(filename,'w');
-fprintf(fid,'%s\n','## Name:');
-fprintf(fid,'%s\n','## Icon:0');
-fprintf(fid,'%s\n','# Points Count  Value');
-fprintf(fid,'1 1.\n');
-fprintf(fid,'%s\n','# X pos Y pos');
-fprintf(fid,'%10.10f %10.10f\n',[a.x a.y]');
-fprintf(fid,'\n','');
-fclose(fid);
Index: issm/trunk/src/m/utils/Exp/readwrite/put_file.m
===================================================================
--- issm/trunk/src/m/utils/Exp/readwrite/put_file.m	(revision 2605)
+++ 	(revision )
@@ -1,31 +1,0 @@
-function put_file(a,file_name);
-%PUT_FILE - ???
-%
-%   Usage:
-%      put_file(a,file_name)
-
-fid=fopen(file_name,'wt');
-for n=1:length(a),
-   
-   newline(fid);
-   fprintf(fid,'%s %s\n','## Name:');
-   newline(fid);
-   fprintf(fid,'%s %s\n','## Icon:0');
-   newline(fid);
-   fprintf(fid,'%s %s %s %s\n','# Points Count Value');
-   newline(fid);
-   fprintf(fid,'%i %f\n',[length(a(n).x)+1 1]);
-   fprintf(fid,'%s %s %s %s %s\n','# X pos Y pos');
-   newline(fid);
-
-	for i=1:length(a(n).x),
-         fprintf(fid,'%f %f\n',[a(n).x(i) a(n).y(i)]);
-   end  
-   if n==length(a),
-      fprintf(fid,'%f %f',[a(n).x(1) a(n).y(1)]);
-   else
-      fprintf(fid,'%f %f\n',[a(n).x(1) a(n).y(1)]);
-   end
-
-end
-fclose(fid);
Index: issm/trunk/src/m/utils/Exp/readwrite/readline.m
===================================================================
--- issm/trunk/src/m/utils/Exp/readwrite/readline.m	(revision 2605)
+++ 	(revision )
@@ -1,12 +1,0 @@
-function B=readline(fid,n)
-%READLINE - ???
-%
-%   Usage:
-%      B=readline(fid,n)
-
-[B,bytecount]=fscanf(fid,'%s',[1]);
-for i=2:n,
-   [A,bytecount]=fscanf(fid,'%s',[1]);
-   B=[B ' ' A];
- end
-
