sfprint - Print a graphical view of Stateflow charts

Syntax

sfprint
sfprint( objects, format, outputOption, printEntireChart )

Arguments

objects

Any of these object identifiers:

  • String name of a Stateflow chart, or Simulink model, system, or block

  • Handle to a Stateflow chart, or Simulink model, system, or block

  • Cell array of names of and/or handles to a Stateflow chart, or Simulink model, system, or block

  • Vector of handles to a Stateflow chart, or Simulink model, system, or block

  • Simulink model construction commands gcb, gcbh, or gcs

format

Optional literal string that specifies the print destination:

  • 'default' prints to a default printer

  • 'ps' generates a PostScript file

  • 'psc' generates a color PostScript file

  • 'eps' generates an Encapsulated PostScript file

  • 'epsc' generates a color Encapsulated PostScript file

  • 'tif' generates a TIFF file

  • 'jpg' generates a JPEG file

  • 'png' generates a PNG file

  • 'meta' saves the Stateflow chart image to the clipboard as a metafile (for Windows® operating systems only)

  • 'bitmap' saves the Stateflow chart image to the clipboard as a bitmap (for Windows operating systems only)

outputOption

Optional string that specifies an output file or printer:

  • String that specifies the name of a file to which to write (file will be overwritten if more than one chart is printed)

  • 'promptForFile' prompts for file name interactively

  • 'printer' sends output to default printer (use only with 'default', 'ps', or 'eps' formats)

  • 'file' sends output to a default file, specified as <path to object>.<device extension>

  • 'clipboard' copies output to the clipboard

printEntireChart

Optional Boolean argument:

  • 1 (default) prints complete charts

  • 0 prints current view of charts

Description


sfprint prints the current Stateflow chart to a default printer.

sfprint( objects, format, outputOption, printEntireChart ) prints all Stateflow charts identified in objects in the specified format to the file or printer specified in outputOption. Prints a complete or current view of charts as specified in printEntireChart. If the format argument is absent, the format defaults to 'ps' and output is sent to the default printer. If the outputOption argument is absent, the name of the Stateflow chart in the current directory is used as the output file name.

Examples

Print the complete chart whose handle is id to a TIFF file called myFilename.

sfprint(id, 'tif', 'myFilename')

Print all Stateflow charts in the current system as a PostScript file to the default printer.

sfprint(gcs)

Print the current Stateflow block to a JPEG file whose name is specified by the user interactively.

sfprint(gcb, 'jpg', 'promptForFile')

Print the current view of all Stateflow charts in the current system in PNG format using default file names.

sfprint(gcs, 'png', 'file', 0)

Assume that you loaded a Simulink model named myModel that has two charts named Chart1 and Chart2. Further, both Chart1 and Chart2 are represented by the Stateflow chart objects ch1 and ch2, respectively.

This command...

Prints the graphical view of...

sfprint('myModel')

Both Chart1 and Chart2 to the default printer

sfprint('myModel','ps')

Both Chart1 and Chart2 to a PostScript file

sfprint(ch1.Id,'psc')

Chart1 to a color PostScript file

sfprint([ch1.Id, ch2.Id])

Both Chart1 and Chart2 to the default printer

See Also

sfhelp, sfnew, sfsave, stateflow

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS