\documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \begin{document} \section*{Matlab test} This is rudamentary test of Matlab. We'll just test simple things like this: \begin{Matlabcode} x = [1 2 3 4 5]; y = [6 6.5 7 7 6.5]; z = x + y \end{Matlabcode} We can also see how plots come out. This one is the default $6\times6$ size in pdf format, scaled to $\frac13$ of that: \begin{Matlabcode}{fig, dispw=2in} plot(x,y); \end{Matlabcode} \\ The Matlab people really should change the way they scale plots so that the plotted data don't run up against the edges like that. This is a different plot, constructed to be 4 inches by 3 inches, PNG format: \begin{Matlabcode}{fig, width=4in, height=3in, figfmt=png} plot(x,z); \end{Matlabcode} \end{document}