set(gca, 'TickDir', 'out', 'XColor', [0.25 0.25 0.25], 'YColor', [0.25 0.25 0.25]);
set(gca, 'YLim', [0 200], 'YTick', [0 100 200], 'YTickLabel', []);
set(gcf,'units','centimeters');
pos = get(gcf, 'position');
set(gcf, 'position', [pos(1:2),5 ,5]); % make figure 5cm x 5cm
box off; % remove axes on right and top
matlabfrag('filename'); % export a .tex and a .eps file using matlabfrag
Export plots from MATLAB as EPS. \usepackage epstopdf in LaTeX.
MATLAB printing and exporting.
Using the same font in the figures and the LaTeX document
LaTeX documents, by default, use the Computer Modern font. It's often considered a good idea to use as few fonts as possible on a single page (otherwise it risks looking ugly). Hence it would be nice to use Computer Modern for figure text. (This is achieved easily when using GNUplot to create figures using GNUplot's epslatex output terminal).
MATLAB simply cannot set the tick font to Computer Modern. You can attempt to set the label font to computer modern using something like this:
set(0, 'defaultTextInterpreter', 'latex');
set(0, 'defaultTextFontName', 'cmr10');
But that also seems to result in the x-axis label being cropped off for small figures (say 5 x 5cm). Tinkering with the label's y Position and the axes's y Position and height seems to be able to fix this problem but this seems like a lot of work, especially given that the output is always going to be unsatisfactory because the tick labels are a different font.
But the user-submitted script teximage.m may be a good bet (I haven't tried it) for rendering fonts using LaTeX and inserting the resulting bitmap into the EPS image.
Remarkably, MATLAB does not have in-built support for exporting figures as EPS files with placeholders plus a TEX file (hence allowing LaTeX to do the typesetting). But there are some user-submitted scripts. The most promising looks to be matlabfrag (I haven't tried it yet though).