Index: /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp
===================================================================
--- /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp	(revision 2626)
+++ /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp	(revision 2627)
@@ -53,5 +53,5 @@
 	/*checks on arguments on the matlab side: */
 	//CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToMeshUsage); Cant' use it here, as we have variable  outputs.
-	if((nlhs==0) && (nrhs!=NRHS)){
+	if((nlhs!=1 && nlhs!=2) || (nrhs!=NRHS)){
 		ContourToMeshUsage();
 		throw ErrorException(__FUNCT__," usage. See above");
@@ -119,16 +119,19 @@
 void ContourToMeshUsage(void)
 {
-	printf("   CONTOURTOMESH - Flag the elements or nodes inside a contour\n\n");
-	printf("      index,x,y: delaunay triangulation.\n");
-	printf("      contours: structure holding sets of vertices making open contours.\n");
-	printf("      interptype: string definining type of interpolation ('element', or 'node').\n");
-	printf("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
-	printf("      in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', \n");
-	printf("              or of size 0 otherwise.\n");
-	printf("      in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', \n");
-	printf("               or of size 0 otherwise.\n\n");
+	printf("CONTOURTOMESH - Flag the elements or nodes inside a contour\n");
+	printf("\n");
 	printf("      Usage: \n");
 	printf("         [in_nod,in_elem]=ContourToMesh(index,x,y,contours,interptype,edgevalue)\n\n");
-	printf("      Exemple: \n");
+	printf("\n");
+	printf("         index,x,y: mesh triangulation.\n");
+	printf("         contours: structure holding sets of vertices making open contours.\n");
+	printf("         interptype: string definining type of interpolation ('element', or 'node').\n");
+	printf("         edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
+	printf("         in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', \n");
+	printf("            or of size 0 otherwise.\n");
+	printf("         in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', \n");
+	printf("            or of size 0 otherwise.\n");
+	printf("\n");
+	printf("      Example: \n");
 	printf("         in_nod=ContourToMesh(md.elements,md.x,md.y,expread('Contour.exp',1),'node',1)\n");
 	printf("         in_elements=ContourToMesh(md.elements,md.x,md.y,expread('Contour.exp',1),'element',0)\n");
Index: /issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 2626)
+++ /issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 2627)
@@ -72,12 +72,21 @@
 void InterpFromGridToMeshUsage(void)
 {
-	_printf_("   usage:\n");
-	_printf_("   data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,defult_value);\n\n");
-	_printf_("   where:\n");
-	_printf_("      x,y: coordinates of matrix data\n");
-	_printf_("      data - matrix holding the data to be interpolated onto the mesh.\n");
-	_printf_("      x_mesh,y_mesh: coordinates of the mesh grids onto which we interpolate.\n");
-	_printf_("      default_value: default value if no interpolation is found.\n");
-	_printf_("      data_mesh:  vector of mesh interpolated data.\n");
+	_printf_("INTERPFROMGRIDTOMESH - interpolation from a grid onto a list of points\n");
+	_printf_("\n");
+	_printf_("   This function is a multi-threaded mex file that interpolates a field\n");
+	_printf_("   defined on a grid onto a list of points\n");
+	_printf_("\n");
+	_printf_("   Usage:\n");
+	_printf_("      data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);\n");
+	_printf_("\n");
+	_printf_("      data: matrix holding the data to be interpolated onto the mesh.\n");
+	_printf_("      x,y: coordinates of matrix data. (x and y must be in increasing order)\n");
+	_printf_("      x_mesh,y_mesh: coordinates of the points onto which we interpolate.\n");
+	_printf_("      default_value: default value if no data is found (holes).\n");
+	_printf_("      data_mesh: vector of mesh interpolated data.\n");
+	_printf_("\n");
+	_printf_("   Example:\n");
+	_printf_("      load('velocities.mat');\n");
+	_printf_("      md.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.x,md.y,0);\n");
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp	(revision 2626)
+++ /issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp	(revision 2627)
@@ -64,12 +64,16 @@
 void InterpFromMeshToGridUsage(void)
 {
-	_printf_("   usage:\n");
-	_printf_("   [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,cornereast,cornernorth,xposting,yposting,nlines,ncols,default_value)\n");
+	_printf_("INTERPFROMMESHTOGRID - interpolation of a data defined on a mesh onto a grid\n");
 	_printf_("\n");
-	_printf_("   where:\n");
+	_printf_("   This function is a multi-threaded mex file that interpolates a field\n");
+	_printf_("   defined on a triangular mesh onto a regular grid\n");
 	_printf_("\n");
-	_printf_("   index,x,y: delaunay triangulation defining the mesh.\n");
-	_printf_("   meshdata: vertex values of data to be interpolated.\n");
-	_printf_("   cornereast,cornernorth,posting,nlines,ncols: parameters that define the grid\n");
-	_printf_("   default_value: value of points located out of the mesh.\n");
+	_printf_("   Usage:\n");
+	_printf_("      [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,cornereast,cornernorth,xposting,yposting,nlines,ncols,default_value)\n");
+	_printf_("\n");
+	_printf_("      index,x,y: delaunay triangulation defining the mesh.\n");
+	_printf_("      meshdata: vertex values of data to be interpolated.\n");
+	_printf_("      cornereast,cornernorth,posting,nlines,ncols: parameters that define the grid\n");
+	_printf_("      default_value: value of points located out of the mesh.\n");
+	_printf_("\n");
 }
Index: /issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 2626)
+++ /issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 2627)
@@ -93,13 +93,22 @@
 void InterpFromMeshToMesh2dUsage(void)
 {
-	_printf_("   usage:\n");
-	_printf_("      data_prime=InterpFromMeshToMesh2d(index,x,y,data,x_prime,y_prime,default_value);\n\n");
-	_printf_("   where:\n");
+	_printf_("INTERPFROMMESHTOMESH2D - interpolation from a 2d triangular mesh onto a list of point\n");
+	_printf_("\n");
+	_printf_("   This function is a multi-threaded mex file that interpolates a field\n");
+	_printf_("   defined on a triangular mesh onto a list of point\n");
+	_printf_("\n");
+	_printf_("   Usage:\n");
+	_printf_("      data_prime=InterpFromMeshToMesh2d(index,x,y,data,x_prime,y_prime,default_value);\n");
+	_printf_("\n");
+	_printf_("      index: index of the mesh where data is defined\n");
 	_printf_("      x,y: coordinates of the nodes where data is defined\n");
-	_printf_("      index: index of the mesh where data is defined\n");
-	_printf_("      data - vector holding the data to be interpolated onto the points.\n");
-	_printf_("      x_prime,y_prime: coordinates of the mesh grids onto which we interpolate.\n");
-	_printf_("      default_value - default value if no interpolation is found.\n");
-	_printf_("      data_prime:  vector of prime interpolated data.\n");
+	_printf_("      data: matrix holding the data to be interpolated onto the mesh.\n");
+	_printf_("      x_prime,y_prime: coordinates of the points onto which we interpolate.\n");
+	_printf_("      default_value: default value if no data is found (holes).\n");
+	_printf_("      data_prime: vector of mesh interpolated data.\n");
+	_printf_("\n");
+	_printf_("   Example:\n");
+	_printf_("      load('temperature.mat');\n");
+	_printf_("      md.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.x,md.y,253);\n");
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 2626)
+++ /issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 2627)
@@ -98,13 +98,22 @@
 void InterpFromMeshToMesh3dUsage(void)
 {
-	_printf_("   usage:\n");
-	_printf_("      data_prime=InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value);\n\n");
-	_printf_("   where:\n");
+	_printf_("INTERPFROMMESHTOMESH3D - interpolation from a 3d hexahedron mesh onto a list of point\n");
+	_printf_("\n");
+	_printf_("   This function is a multi-threaded mex file that interpolates a field\n");
+	_printf_("   defined on a triangular mesh onto a list of point\n");
+	_printf_("\n");
+	_printf_("   Usage:\n");
+	_printf_("      data_prime=InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value);\n");
+	_printf_("\n");
+	_printf_("      index: index of the mesh where data is defined\n");
 	_printf_("      x,y,z: coordinates of the nodes where data is defined\n");
-	_printf_("      index: index of the mesh where data is defined\n");
-	_printf_("      data - vector holding the data to be interpolated onto the points.\n");
-	_printf_("      x_prime,y_prime,z_prime: coordinates of the mesh grids onto which we interpolate.\n");
-	_printf_("      default_value - default value if no interpolation is found.\n");
-	_printf_("      data_prime:  vector of prime interpolated data.\n");
+	_printf_("      data: matrix holding the data to be interpolated onto the mesh.\n");
+	_printf_("      x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate.\n");
+	_printf_("      default_value: default value if no data is found (holes).\n");
+	_printf_("      data_prime: vector of mesh interpolated data.\n");
+	_printf_("\n");
+	_printf_("   Example:\n");
+	_printf_("      load('temperature.mat');\n");
+	_printf_("      md.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.x,md.y,md.z,253);\n");
 	_printf_("\n");
 }
