Trinh @ Bath

This is an old revision of the document!


Matlab startup file

Use a similar startup.m script below to set figure defaults. This ensures that axis labels are appropriately sized.

Run this command to open the startup file

  1. edit(fullfile(userpath,'startup.m'))
  1. % Example startup file
  2.  
  3. % This adds all paths recursively from the directory
  4. addpath(genpath('~/myfunctions'));
  5. % This adds a single path
  6. addpath ~/mysinglepath/
  7.  
  8. % Set figure default to something more pragmatic
  9.  
  10. colordef white
  11. set(0, 'Units', 'pixels');
  12.  
  13. set(0, 'defaultaxesfontsize', 18, 'defaultaxeslinewidth', 1, ...
  14. 'defaultlinelinewidth', 1, 'defaultpatchlinewidth', .7, ...
  15. 'defaultAxesFontSize', 18);
  16.  
  17.  
  18. set(0,'DefaultFigureColor','w', ...
  19. 'DefaultAxesColor','w',...
  20. 'DefaultAxesXColor','k',...
  21. 'DefaultAxesYColor','k',...
  22. 'DefaultAxesZColor','k',...
  23. 'DefaultTextColor','k',...
  24. 'DefaultLineColor','k');
  25.  
  26. clear
  27. close all
  28.  
  29. % Add the starting path
  30. cd ~/mystartingpath/