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 @@ -1,14 +1,17 @@ -function write_matrix(matrix,name); +function write_matrix(matrix,name,extn); % Writes the matrix function file % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.6 2000/12/27 16:06:17 peterg +% %% *** empty log message *** +% %% % %% Revision 1.5 1998/02/03 08:40:39 peterg % %% Fixed a horrible bug -- changed filename -> filenum % %% % %% Revision 1.4 1996/08/15 11:56:11 peter % %% Does complex matrices. @@ -23,11 +26,15 @@ % %% Initial revision % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -filename = [name, '.m']; +if nargin<3 + extn="m"; +endif + +filename = sprintf("%s.%s", name, extn); filenum = fopen(filename,'w'); % Write the function m-file for the causal bond graph pc = '%'; fprintf(filenum, 'function data = %s\n', name);