Index: mttroot/mtt/bin/trans/dm_r2m ================================================================== --- mttroot/mtt/bin/trans/dm_r2m +++ mttroot/mtt/bin/trans/dm_r2m @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +# Revision 1.6 1997/04/16 13:43:29 peterg +# Added matrix dimenensions +# # Revision 1.5 1997/02/24 14:44:28 peterg # Ignores numerical parameters in global list. # ## Revision 1.4 1996/08/24 14:16:25 peter ## Global parameter passing. @@ -49,11 +52,11 @@ %Set up the number of argument variables to zero in case the user has forgotten MTTNVar := 0; %Read in the parameter file -in "$1_sympar.r"; +%%in "$1_sympar.r"; %Read the reduce state-space A,B,C and D matrices file in "$1_dm.r"; IF MTTNvar>0 THEN @@ -102,32 +105,24 @@ SHUT "$1_dm.1"; EOF -#Write some file headers -echo "function [A,B,C,D,E] = $1_dm" > $1_dm.m -echo "% Descriptor matrix function for system $1 ($1_dm.m)" >> $1_dm.m -echo "% Generated by MTT at `date`" >> $1_dm.m -echo >> $1_dm.m - -#Globals -sympar2global_txt2m $1 >> $1_dm.m -echo ';'>> $1_dm.m -echo >> $1_dm.m +# Header +matlab_header $1 dm> $1_dm.m #Define array sizes. grep -v 'function' $1_def.m | grep -v '%' >> $1_dm.m -echo 'mtta = zeros(nx+nyz,nx+nyz);' >> $1_dm.m -echo 'mttb = zeros(nx+nyz,nu);' >> $1_dm.m -echo 'mttc = zeros(ny,nx+nyz);' >> $1_dm.m -echo 'mttd = zeros(nu,nu);' >> $1_dm.m -echo 'mtte = zeros(nx+nyz,nx+nyz);' >> $1_dm.m +echo 'mtta = zeros(nx+nyz+2*nz,nx+nyz+2*nz);' >> $1_dm.m +echo 'mttb = zeros(nx+nyz+2*nz,nu);' >> $1_dm.m +echo 'mttc = zeros(ny,nx+nyz+2*nz);' >> $1_dm.m +echo 'mttd = zeros(ny,nu);' >> $1_dm.m +echo 'mtte = zeros(nx+nyz+2*nz,nx+nyz+2*nz);' >> $1_dm.m #Code cat $1_dm.1 >> $1_dm.m rm -f $1_dm.1