Index: /issm/trunk/src/c/EnumDefinitions/SynchronizeMatlabEnum.sh
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/SynchronizeMatlabEnum.sh	(revision 1641)
+++ /issm/trunk/src/c/EnumDefinitions/SynchronizeMatlabEnum.sh	(revision 1642)
@@ -7,4 +7,15 @@
 echo "Synchronizong with Matlab's Enums..."
 cat EnumDefinitions.cpp | grep "return" | grep "int" | awk '{ printf "line%so %s\n", NR, $0 }' | sed -e "s/(void){//"  > temp
+cat <<END > AnalysisTypeAsEnum.m
+function string=AnalysisTypeAsEnum(enum)
+%ANALYSISASENUM - get analysis type from Enum
+%
+%   file generated by src/c/SynchronizeMatlabEnum
+%   to be synchronized with the corresponding C Enum
+%   located in src/c/EnumDefinitions
+%
+%   Usage:
+%      string=AnalysisTypeAsEnum(enum)
+END
 
 #get number of lines in temp
@@ -20,15 +31,24 @@
 
 	#write corresponding Matlab file
-	cat <<END > `echo $NAME.m`
+	cat <<END > $(echo $NAME.m)
 function macro=$(echo $NAME)()
 %$(echo `echo $NAME | sed -e "s/[a-z]/\U&/g"`) - Enum of $(echo `echo $NAME | sed -e "s/Enum//"`)
 %
+%   file generated by src/c/SynchronizeMatlabEnum
 %   to be synchronized with the corresponding C Enum
 %   located in src/c/EnumDefinitions
 %
 %   Usage:
-%      macro=$(echo $NAME)()
+%      macro=$NAME()
 
-macro=$(echo $ENUM)
+macro=$ENUM
+END
+
+	#update AnalysisTypeAsEnum
+	cat <<END >> AnalysisTypeAsEnum.m
+
+if enum==$NAME(),
+	string='$(echo `echo $NAME | sed -e "s/AnalysisEnum//g" | awk {'print tolower($_)'}`)';
+end
 END
 
@@ -39,3 +59,4 @@
 
 #clean up
+mv AnalysisTypeAsEnum.m $ISSM_DIR/src/m/shared/
 rm temp
