Main Content

slwebview

Export Simulink models to web views

Description

slwebview starts the web view dialog box in the Report Explorer.

example

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

filename = slwebview(folder) exports all models in a folder. See RecurseFolder to include models in subfolders.

example

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

Examples

collapse all

Open the slrgex_fuelsys model.

open_system("slrgex_fuelsys")

Export the Engine Gas Dynamics subsystem and the system that contains it to a web view. Do not export the subsystems that it contains.

fuelsys_web_view1 = slwebview(...
"slrgex_fuelsys/Engine Gas Dynamics","SearchScope","CurrentAndAbove")

Navigate to the Engine_Gas_Dynamics folder and open webview.html in a web browser. See Display and Navigate Through Web Views. Here is the web view:

Open the slrgex_fuelsys model.

open_system("slrgex_fuelsys")

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

fuelsys_web_view2 = slwebview(...
"slrgex_fuelsys","FollowModelReference","on")

Navigate to the slrgex_fuelsys folder and open webview.html in a web browser. See Display and Navigate Through Web Views. Here is the web view:

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

Input Arguments

collapse all

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.

Path to the file folder containing one or more models to export to a web view file, specified as a string. All models in the folder are exported.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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.

'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

'none' 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.

'all' exports all masked blocks.

Data Types: char

Whether to include user notes, specified as numeric or logical 0 (false) or 1 (true).

Data Types: logical | numeric

'off' does not allow you to access referenced models in a web view.

'on' allows you to access referenced models in a web view.

Data Types: char

Whether to export models in subfolders to a web View file, specified as a logical. If false, the web view includes models only in the top-level folder and does not include models in subfolders. If true, models in subfolders are also included. This property applies only if you specify a folder as an input argument.

Name of the web view output package, specified as a character vector. The web view output is a .zip file or folder of unzipped web view files, or both types of outputs.

Data Types: char

Path in which to place the packaged web view, specified as a character vector. To save the packaged web view in the same folder as the model, use $model as the PackageFolder.

Data Types: char

Type of web view output package, specified as a zipped file, a folder of unzipped files, or both a zipped file and folder of unzipped files.

Data Types: char

Optional views to include, specified as a cell array that contains one or both of these values:

  • 'requirements'

  • 'coverage'

See Include Model Requirements and Coverage Data in Web Views.

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: logical

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: logical

Option to export the model incrementally, specified as numeric 0 or 1 or logical true or false. Use IncrementalExport to specify whether to use full or incremental export mode.

If IncrementalExport is false, slwebview completely regenerates web views that you have previously exported.

If IncrementalExport and FollowModelReference are true:

  • When you export a model, slwebview reuses cached web views for the top model or referenced models or subsystems that have not changed since you last ran slwebview.

  • slwebview caches web views in the current simulation cache folder. To reuse existing web views, use a common simulation cache folder for web view export.

Only changes that dirty a model trigger web view regeneration. Certain changes to model behavior or model appearance do not dirty the model and thus do not trigger web view regeneration. For example, changing the name of a tunable parameter triggers regeneration, but changing the value of a tunable parameter does not trigger regeneration. To force regeneration of a web view, delete the model's simulation cache file in the current simulation cache folder.

Caching new or updated web views increases export time, but reusing cached web views reduces export time. For this reason, use incremental export only if you enable FollowModelReference and the model contains numerous model or subsystem references.

Data Types: logical | numeric

Output Arguments

collapse all

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

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.

Version History

Introduced in R2006a