Index: /issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp	(revision 14004)
+++ /issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp	(revision 14005)
@@ -264,25 +264,17 @@
 
 	double* outvector=NULL;
-	int outvector_rows;
-
-	if(mxIsEmpty(dataref)){
-		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-		outvector_rows=0;
-		outvector=NULL;
-	}
-	else if (mxIsClass(dataref,"double") ){
-
-		/*Convert matlab vector to double*  vector: */
-		MatlabVectorToDoubleVector(&outvector,&outvector_rows,dataref);
-
-	}
-	else{
-		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+	int M,N;
+
+	/*Use Fetch matrix*/
+	FetchData(pvector,&M,&N,dataref) ;
+
+	/*Check that it is a vector*/
+	if(M>0){
+		if(N!=1) _error_("input vector of size " << M << "x" << N << " should have only one column");
 	}
 
 	/*Assign output pointers:*/
 	*pvector=outvector;
-	if (pM)*pM=outvector_rows;
+	if(pM)*pM=M;
 }
 /*}}}*/
