User Tools

Site Tools


info:linux

Useful Tips for Linux

This page summarizes some tips for beginners as well as solutions I face during daily work.

Matlab Tips

Function skeleton

To arrive at your own custom skeleton for new .m files, you may insert your skeleton before line 121 of edit.m. Notice that matlab will load edit.m on startup and changes to edit.m thereafter won't be seen until rebooting matlab. Example:

% ...
else
        file_1 = fopen(fileName, 'w'); % line 121 here
        fprintf(file_1, '%% #######################\n');
        fprintf(file_1, '%% # %s\n', fileName);
        fprintf(file_1, '%% # Author(s): L.Doblies\n');
        fprintf(file_1, '%% # %s\n', date);
        fprintf(file_1, '%% #######################\n\n');
        fprintf(file_1, 'function ret = %s()\n\n', fileNameWithoutExtension);
        fprintf(file_1, 'end');
        openEditor(fullfile(path,fileName)); % this was @line 121 before
end
% ... 
info/linux.txt · Last modified: 2010/08/09 19:45 by moritz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki