Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


How to PRINT a matlab PLOT or Simulink BLOCK DIAGRAM

The Matlab "print" command can be used either to print the current
plot to a printer or to save the plot to a file.

The Matlab command:

        >> print -Pprintername

will send the current plot to the printer "printername". If you have
multiple plot windows, you can select the window to print with the
"-fhandle" or "-fwindow_title" option. For example, to print Figure
No. 2, you can use

        >> print -f2 

To print a Simulink block diagram, use the "-ssystem"  option.
For example, to print the Simulink block diagram entitled "f14"

        >> print -sf14

will print it to the default printer.  The command

        >> print -dps  filename.ps

will save the current plot to the file "filename.ps". To save multiple
plots in one file, use the "-append" option. For example, the following
sequence shows how to save and print 3 plots in one file called
"example.ps":
    
           >> plot(sin([0:25]*2*pi/25));
           >> print -dps  example.ps
           >> plot(sin([0:25]*4*pi/25));
           >> print -dps -append example.ps
           >> plot(sin([0:25]*8*pi/25));
           >> print -dps -append example.ps

Then to print example.ps to the printer ajax, use the lpr command at
the athena prompt:

           athena%  lpr -Pajax example.ps

The "print" command supports a number of output types including:

           -dps    - PostScript for black and white printers
           -dpsc   - PostScript for color printers
           -deps   - Encapsulated PostScript (EPSF)
           -depsc  - Encapsulated Color PostScript (EPSF)

Type "help print" at the Matlab prompt for more information on the
options available for the print command.

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.