Index: mttroot/mtt/bin/trans/txt2m ================================================================== --- mttroot/mtt/bin/trans/txt2m +++ mttroot/mtt/bin/trans/txt2m @@ -13,20 +13,23 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.1 1998/02/25 22:10:25 peterg +# %% Initial revision +# %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% system=$1 representation=$2 if [ "$representation" = "state" ]; then - name='x'; + name='MTTx'; fi if [ "$representation" = "input" ]; then - name='u'; + name='MTTu'; fi # Inform user echo Creating $1_$2.m #Create the $2 file complete with headers. @@ -33,22 +36,22 @@ echo "function $name = $1_$2(t)" > $1_$2.m echo "%% $2 file ($1_$2.m)" >> $1_$2.m echo "%% Generated by MTT at `date`" >> $1_$2.m # Global variable list -echo >> $1_$2.m -echo 'if (nargin==0), t=0; end;'>> $1_$2.m -echo >> $1_$2.m +#echo >> $1_$2.m +#echo 'if (nargin==0), t=0; end;'>> $1_$2.m +#echo >> $1_$2.m echo "% Global variable list" >> $1_$2.m sympar2global_txt2m $1 >> $1_$2.m -echo "global DT;" >> $1_$2.m +#echo "global DT;" >> $1_$2.m #Write out the variables in m format. awk -F# '{ if (NF<2) print $1 - if (NF>1) print $1 "% " $2 + if (NF>1) print $1 "# " $2 }' $1_$2.txt | \ sed 's/{//' | sed 's/}/end/' >> $1_$2.m