view m-toolbox/sltpda/sltpda_cmds2m.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

function sltpda_cmds2m(mdlfile, cmds, mfile)

% SLTPDA_CMDS2M write a runable m-file from the given command list.
% 
% usage: sltpda_cmds2m(mdlfile, cmds, mfile)
% 
% M Hewitson 27-03-07
% 


ALGONAME = mfilename;
VERSION  = '$Id: sltpda_cmds2m.m,v 1.1 2007/03/30 08:24:36 hewitson Exp $';



[path,name,ext,vers] = fileparts(mfile);
if isempty(ext)
  mfile = [mfile '.m'];
end


% write m file
fd = fopen(mfile, 'w+');

fprintf(fd, '%% %s \n', upper(mfile));
fprintf(fd, '%% \n');
fprintf(fd, '%% written by %s / %s\n', ALGONAME, VERSION);
fprintf(fd, '%%   on %s\n', sprintf('%s', datestr(now)));
fprintf(fd, '%% \n');
fprintf(fd, '%% based on mdl file: %s\n', mdlfile);
fprintf(fd, '%% \n');
fprintf(fd, '%% \n');
fprintf(fd, ' \n');
fprintf(fd, 'clear; \n');
for c=1:length(cmds)
  fprintf(fd, '%s\n', cmds(c).cmd);
end
fprintf(fd, ' \n');
fprintf(fd, ' \n');
fprintf(fd, '%% END\n');
fclose(fd);


% END