Index: mttroot/mtt/bin/trans/m/write_matrix.m ================================================================== --- mttroot/mtt/bin/trans/m/write_matrix.m +++ mttroot/mtt/bin/trans/m/write_matrix.m @@ -5,10 +5,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.4 1996/08/15 11:56:11 peter +% %% Does complex matrices. +% %% % %% Revision 1.3 1996/08/14 19:20:41 peter % %% Fixed output naming bug. % %% % %% Revision 1.2 1996/08/14 08:36:52 peter % %% Puts a tab between columns. @@ -25,29 +28,29 @@ % Write the function m-file for the causal bond graph pc = '%'; fprintf(filenum, 'function data = %s\n', name); fprintf(filenum, '%s data = %s\n\n', pc, name); -fprintf(filename, 'data = [\n'); +fprintf(filenum, 'data = [\n'); [N,M] = size(matrix); for row = 1:N for col = 1:M re = real(matrix(row,col)); im = imag(matrix(row,col)); - fprintf(filename, '%g', re); + fprintf(filenum, '%g', re); if im ~= 0 - fprintf(filename, '+ %g*i', im); + fprintf(filenum, '+ %g*i', im); end if col