Index: /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp	(revision 4204)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp	(revision 4205)
@@ -28,5 +28,5 @@
 int MatlabVectorToDoubleVector(double** pvector,int* pvector_rows,const mxArray* mxvector){
 
-	int rows, cols;
+	int rows,cols,size;
 	double* mxvector_ptr=NULL;
 	int ierr;
@@ -52,4 +52,8 @@
 		cols=mxGetN(mxvector);
 		nnz=mxGetNzmax(mxvector);
+		
+		/*Check that input is actualy a vector*/
+		if (cols!=1) ISSMERROR("input vector of size %ix%i should have only one column",rows,cols);
+
 		nz=(int)((double)nnz/(double)rows);
 
@@ -78,4 +82,7 @@
 		cols=mxGetN(mxvector);
 
+		/*Check that input is actualy a vector*/
+		if (cols!=1) ISSMERROR("input vector of size %ix%i should have only one column",rows,cols);
+
 		/*allocate and memcpy*/
 		vector=(double*)xmalloc(rows*sizeof(double));
