Index: mttroot/mtt/bin/trans/m/makedef.m ================================================================== --- mttroot/mtt/bin/trans/m/makedef.m +++ mttroot/mtt/bin/trans/m/makedef.m @@ -3,77 +3,79 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 1996/08/18 20:05:20 peter +% %% Put unded version control +% %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -if nargin<2 - deffile = 'stdout'; -end; +filenum = fopen(deffile,'w'); states = structure(1); nonstates=structure(2); inputs=structure(3); outputs=structure(4); zero_outputs = structure(5); pc = '%'; % Declare reduce constants; -fprintf(deffile, 'MTTNx := %1.0f;\n', states); -fprintf(deffile, 'MTTNz := %1.0f;\n', nonstates); -fprintf(deffile, 'MTTNu := %1.0f;\n', inputs); -fprintf(deffile, 'MTTNy := %1.0f;\n', outputs); -fprintf(deffile, 'MTTNyz := %1.0f;\n', zero_outputs); +fprintf(filenum, 'MTTNx := %1.0f;\n', states); +fprintf(filenum, 'MTTNz := %1.0f;\n', nonstates); +fprintf(filenum, 'MTTNu := %1.0f;\n', inputs); +fprintf(filenum, 'MTTNy := %1.0f;\n', outputs); +fprintf(filenum, 'MTTNyz := %1.0f;\n', zero_outputs); % Declare reduce matrices -fprintf(deffile, '%s Declare reduce matrices\n', pc); +fprintf(filenum, '%s Declare reduce matrices\n', pc); if states>0 - fprintf(deffile, 'matrix MTTx(%1.0f,1);\n', states); - fprintf(deffile, 'matrix MTTdx(%1.0f,1);\n', states); + fprintf(filenum, 'matrix MTTx(%1.0f,1);\n', states); + fprintf(filenum, 'matrix MTTdx(%1.0f,1);\n', states); end; if nonstates>0 - fprintf(deffile, 'matrix MTTz(%1.0f,1);\n', nonstates); - fprintf(deffile, 'matrix MTTdz(%1.0f,1);\n', nonstates); + fprintf(filenum, 'matrix MTTz(%1.0f,1);\n', nonstates); + fprintf(filenum, 'matrix MTTdz(%1.0f,1);\n', nonstates); end; if inputs>0 - fprintf(deffile, 'matrix MTTu(%1.0f,1);\n', inputs); + fprintf(filenum, 'matrix MTTu(%1.0f,1);\n', inputs); end; if outputs>0 - fprintf(deffile, 'matrix MTTy(%1.0f,1);\n', outputs); + fprintf(filenum, 'matrix MTTy(%1.0f,1);\n', outputs); end; if zero_outputs>0 - fprintf(deffile, 'matrix MTTyz(%1.0f,1);\n', zero_outputs); - fprintf(deffile, 'matrix MTTui(%1.0f,1);\n', zero_outputs); + fprintf(filenum, 'matrix MTTyz(%1.0f,1);\n', zero_outputs); + fprintf(filenum, 'matrix MTTui(%1.0f,1);\n', zero_outputs); end; % Make an Nx x Nx unit matrix if states>0 - fprintf(deffile, 'matrix MTTI(%1.0f,%1.0f);\n', states,states); + fprintf(filenum, 'matrix MTTI(%1.0f,%1.0f);\n', states,states); for i = 1:states - fprintf(deffile, 'MTTI(%1.0f,%1.0f) := 1;\n', i, i); + fprintf(filenum, 'MTTI(%1.0f,%1.0f) := 1;\n', i, i); end end; % Set the y, yz, u, x and dx matrices -fprintf(deffile, '%s Set the y, yz, u and x matrices\n', pc); +fprintf(filenum, '%s Set the y, yz, u and x matrices\n', pc); for i=1:outputs - fprintf(deffile, 'MTTy(%1.0f,1) := MTTy%1.0f;\n', i, i); + fprintf(filenum, 'MTTy(%1.0f,1) := MTTy%1.0f;\n', i, i); end; for i=1:zero_outputs - fprintf(deffile, 'MTTyz(%1.0f,1) := MTTyz%1.0f;\n', i, i); - fprintf(deffile, 'MTTui(%1.0f,1) := MTTui%1.0f;\n', i, i); + fprintf(filenum, 'MTTyz(%1.0f,1) := MTTyz%1.0f;\n', i, i); + fprintf(filenum, 'MTTui(%1.0f,1) := MTTui%1.0f;\n', i, i); end; for i=1:inputs - fprintf(deffile, 'MTTu(%1.0f,1) := MTTu%1.0f;\n', i, i); + fprintf(filenum, 'MTTu(%1.0f,1) := MTTu%1.0f;\n', i, i); end; for i=1:states - fprintf(deffile, 'MTTx(%1.0f,1) := MTTx%1.0f;\n', i, i); + fprintf(filenum, 'MTTx(%1.0f,1) := MTTx%1.0f;\n', i, i); end; for i=1:nonstates - fprintf(deffile, 'MTTdz(%1.0f,1) := MTTdz%1.0f;\n', i, i); + fprintf(filenum, 'MTTdz(%1.0f,1) := MTTdz%1.0f;\n', i, i); end; - +fprintf(filenum, 'END;'); +fclose(filenum);