Obtaining a Hardcopy of Your MATLAB Session

The easiest way for you to get a hardcopy of your MATLAB session is to use the diarycommand. For example, the command

        diary filename

causes what appears subsequently on the screen (except graphics) to be written to the named diskfile, filename. If the filename is omitted, the session will be written to a default file named diary until you issue the command

 
        diary off

The command

 
        diary on

will cause writing to the file to resume, etc. When finished, you can edit the file as desired and print it out on the local system. The !-feature (see section on "Managing M-Files") will permit you to print the file without leaving MATLAB. Specifically, at the double chevron (>>) MATLAB prompt, you can enter the command

 
        !lpr -Pprintername filename

where printername is the name of the printer to which you wish to send your output, and filename is the name of the desired file.


Other Matlab Hints

Click on an item listed below to access additional MATLAB-related hints.


Return to ACS home page.


Please send comments and suggestions to

consult@rpi.edu