Index: mttroot/mtt/bin/trans/struc2state_txt2txt ================================================================== --- mttroot/mtt/bin/trans/struc2state_txt2txt +++ mttroot/mtt/bin/trans/struc2state_txt2txt @@ -13,10 +13,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.9 2000/10/10 21:03:06 peterg +# %% *** empty log message *** +# %% # %% Revision 1.8 1998/08/10 13:57:33 peterg # %% Removed debugging lines # %% # %% Revision 1.7 1998/08/10 13:55:11 peterg # %% Added option of computing from ss values @@ -50,11 +53,12 @@ echo "$1 is an invalid argument - ignoring" ;; esac shift done - +# Default state +default='0.0' #Create the state file complete with headers. echo '# -*-octave-*- Put Emacs into octave-mode' > $1_state.txt echo "# Initial state file ($1_state.txt)" >> $1_state.txt echo "# Generated by MTT at `date`" >> $1_state.txt @@ -76,20 +80,21 @@ x[j]=a[2]; } if($1=="state") { i++; - print "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")" + # print "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")" + printf("%s =\t%s; # MTT initial value\n", $4, x[i]); } }' >> $1_state.txt else # Set states to zero # Inform user -echo Creating $1_state.txt - default states to zero +echo Creating $1_state.txt - default states to $default awk '{ - if ($1=="state") printf("mttx(%s) \t= 0.0; \t\# %s (%s)\n", $2,$3,$4) -}' <$1_struc.txt >> $1_state.txt + if ($1=="state") printf("%s \t= %s; # MTT initial value\n", $4, default) +}' default=$default <$1_struc.txt >> $1_state.txt fi