slwebview

Export Simulink models to Web views

Syntax

  • slwebview
  • filename = slwebview(system_name)
  • filename = slwebview(system_name,Name,Value)

Description

slwebview starts the Web View dialog box in the Report Explorer.

filename = slwebview(system_name) exports the subsystem system_name and its child systems to the file filename.

filename = slwebview(system_name,Name,Value) provides additional options specified by one or more Name,Value pairs.

Examples

expand all

Export Web View for a Subsystem and Systems that Contain that Subsystem

Open the fuel rate controller subsystem.

open_system('fuelsys')

Export to a Web view the fuel rate controller subsystem and the system that contains it. Do not export the subsystems that it contains. This example assumes the current folder is the H: drive.

fuelsys_web_view = slwebview...
('fuelsys/fuel rate controller','SearchScope','CurrentAndAbove')
fuelsys_web_view = 

H:\fuel_rate_controller\webview.html

The Web view displays in the system browser.

Export Web View with Access to Referenced Models

Open the sldemo_mdlref_depgraph model.

open_system('sldemo_mdlref_depgraph')

Export to a Web view the sldemo_mdlref_depgraph model and allow access to the models it references.

depgraph_web_view = slwebview...
('sldemo_mdlref_depgraph','FollowModelReference','true')
depgraph_web_view =

H:\sldemo_mdlref_depgraph\webview.html

The Web view displays in the system browser. In the Web view, you can open the models referenced by the Model blocks.

Click a Model block to see its properties. Double-click a Model block to display the referenced model.

Input Arguments

expand all

system_name — The system to export to a Web view filestring containing the path to the system | handle to a subsystem or block diagram | handle to a chart or subchart

Exports the specified system or subsystem and its child systems to a Web view file. By default, child systems of the system_name system are also exported. Use the SearchScope name-value pair to export other systems, in relation to system_name.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: htmlFileName = slwebview(gcs,'LookUnderMasks','all',... 'FollowLinks','on') Export to a Web view all layers of the model hierarchy to which the current system belongs, including the ability to interact with library links and masks.

'SearchScope' — Systems to export, relative to the system_name systemCurrentAndBelow (default) | Current | CurrentAndAbove | All

CurrentAndBelow exports the Simulink® system or the Stateflow® chart specified by system_name and all systems or charts that it contains.

Current exports only the Simulink system or the Stateflow chart specified by system_name.

CurrentAndAbove exports the Simulink system or the Stateflow chart specified by the system_name and all systems or charts that contain it.

All exports all Simulink systems or Stateflow charts in the model that contains the system or chart specified by system_name.

Data Types: char

'LookUnderMasks' — Specifies whether to export the ability to interact with masked blocksfalse (default) | true | none | all | graphical | functional

false does not export masked blocks in the Web view. Masked blocks are included in the exported systems, but you cannot access the contents of the masked blocks.

true exports all masked blocks.

none is supported for compatibility with earlier user code. Do not use this value in new code. This value is equivalent to false.

all is supported for compatibility with earlier user code. Do not use this value in new code. This value is equivalent to true.

graphical is supported for compatibility with earlier user code. Do not use this value in new code. This value is equivalent to all.

functional is supported for compatibility with earlier user code. Do not use this value in new code. This value is equivalent to all.

Data Types: char

false does not allow you to follow links into library blocks in a Web view.

true allows you to follow links into library blocks in a Web view.

Data Types: char

'FollowModelReference' — Specifies whether to access referenced models in a Web viewfalse (default) | true

false does not allow you to access referenced models in a Web view.

true allows you to access referenced models in a Web view.

Data Types: char

'ViewFile' — Specifies whether to display the Web view in a Web browser when you export the Web viewtrue (default) | false

true displays the Web view in a Web browser when you export the Web view.

false does not display the Web view in a Web browser when you export the Web view.

Data Types: char

'ShowProgressBar' — Specifies whether to display the status bar when you export a Web viewtrue (default) | false

true displays the status bar when you export a Web view.

false does not display the status bar when you export a Web view.

Data Types: char

Output Arguments

expand all

filename — The name of the HTML file for displaying the Web viewstring

Reports the name of the HTML file for displaying the Web view. Exporting a Web view creates the supporting files, in a folder.

More About

expand all

Tips

A Web view is an interactive rendition of a model that you can view in a Web browser. You can navigate a Web view hierarchically to examine specific subsystems and to see properties of blocks and signals.

You can use Web views to share models with people who do not have Simulink installed.

Web views require a Web browser that supports SVG, either natively or with an Adobe® SVG plugin. The MATLAB® Web browser does not support Web views.

Was this topic helpful?