MATLAB: How to print from the MATLAB Editor and set the page orientation to landscape

landscapelayoutMATLABorientationportraitprint

I have some code in a MATLAB file that I have opened in the MATLAB Editor. I would like to print this file, but I would like the page orientation to be in landscape. How can I do this?

Best Answer

One option is to print from the Editor as usual and simply set the page orientation accordingly in your system's print dialog that opens as a result. Note that the precise steps (to set the orientation in your system's print dialog) would depend on your particular printer, printer driver, and/or printer software.
An alternative approach to set the page orientation from within MATLAB itself is detailed as follows:
1) Right-click within the Workspace Browser
2) Select the "Page Setup" option in the context menu
3) Specify the "Orientation" and other options
4) This setting should work even if you are printing from the Editor