Main Content

sfprint

Print Stateflow charts

Description

sfprint prints the current chart to the default printer.

example

sfprint(source) prints all charts specified by source to the default printer.

example

sfprint(source,format) prints charts by using the specified format to output files. Each output file name matches the name of the chart and the file extension matches the format.

example

sfprint(source,format,destination) prints charts to the specified destination.

example

sfprint(source,format,destination,wholeChart) specifies whether to print the complete or current view of the charts.

example

Examples

collapse all

sfprint

Prints the current chart to the default printer.

sfprint("sf_car/shift_logic");

Prints the chart with the path sf_car/shift_logic to the default printer.

sfprint("sf_car/shift_logic","jpg")

Prints the chart sf_car/shift_logic in JPG format to the file sf_car_shift_logic.jpg.

sfprint(gcs,"tiff","clipboard")

Prints the chart in the current system to the clipboard in TIFF format.

sfprint("sf_car/shift_logic","png","file",0)

Prints the current view of sf_car/shift_logic in a PNG format to the file sf_car_shift_logic.png.

Input Arguments

collapse all

Source of charts to print, specified as a string scalar or character vector that contains the path of a chart, model, subsystem, or block. To specify multiple paths, use a vector of string scalars or cell array of character vectors. To specify the current block or system of the model, use gcb (Simulink) or gcs (Simulink).

Example: sfprint(gcs) prints all the charts in the current system to the default printer.

Example: sfprint("sf_pool/Pool") prints the chart sf_pool/Pool to the default printer.

Data Types: string | char

Output format of the printed charts specified as one of these values:

  • "bitmap" — Save the chart image to the clipboard as a bitmap (for Windows® operating systems only).

  • "jpg" — Generate a JPEG file.

  • "meta" — Save the chart image to the clipboard as an enhanced metafile (for Windows operating systems only).

  • "pdf" — Generate a PDF file.

  • "png" — Generate a PNG file.

  • "svg" — Generate an SVG file.

  • "tiff" — Generate a TIFF file

Example: sfprint("sf_car/shift_logic","jpg") prints the chart sf_car/shift_logic to a JPEG file named sf_car_shift_logic.jpg in the current folder.

Example: sfprint("sf_bounce/BouncingBall","meta","myImage") prints the chart sf_bounce/BouncingBall as an enhanced metafile named myImage.emf in the current folder.

Destination for printed charts, specified as one of these values:

  • "file" — Send output to a file with the default name chart_name.file_extension, where the file name is the name of the chart and the file extension that matches the output format.

  • "clipboard" — Copy output to the clipboard.

  • "printer" — Send output to the default printer. Use only with "ps" or "eps" formats.

  • "promptForFile" — Prompt for path and file name.

Alternatively, you can specify the name of the output file by using a string scalar or character vector.

Example: sfprint("sf_car/shift_logic","png","myFile") prints the chart sf_car/shift_logic to a PNG file named myFile.png in the current folder.

Example: sfprint(gcb,"pdf","promptForFile") prints all charts in the current block of the model in PDF format. A dialog box prompts you for the path and name of the output file for each chart.

Data Types: string | char

Whether to print the complete charts, specified as a numeric or logical 1 (true) or 0 (false).

  • true — Print the complete views of the specified charts.

  • false — Print the current views of the specified charts.

Example: sfprint(gcs,"png","file",0) prints the current view of the charts in the current system in PNG format using default file names.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Version History

Introduced before R2006a

See Also

(Simulink) | (Simulink) | | | |