slwebview
Export Simulink models to web views
Syntax
Description
slwebview
starts the web view dialog box in the Report
Explorer.
exports the subsystem filename
= slwebview(system_name
)system_name
and its child systems to the
file filename
.
exports all models in a folder. See RecurseFolder to include
models in subfolders.filename
= slwebview(folder
)
provides additional options specified by one or more Name=Value pairs.filename
= slwebview(system_name
,Name=Value
)
Examples
Export Web View for a Subsystem
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")
fuelsys_web_view1 = 'C:\Users\sheile\OneDrive - MathWorks\Documents\MATLAB\ExampleManager\sheile.Bdoc\rptgenext-ex97298442\Engine_Gas_Dynamics.zip'
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:
Export Web View with Access to Referenced Models
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")
fuelsys_web_view2 = '/tmp/Bdoc24b_2679053_1062442/tp58346e5a/rptgenext-ex83825438/slrgex_fuelsys.zip'
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
system_name
— System to export to a web view file
string 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
.
folder
— Path to file folder of models to export
string containing the path to the file folder
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.
SearchScope
— Systems to export, relative to the system_name
system
'CurrentAndBelow'
(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
— Whether to export the ability to interact with masked blocks
'none'
(default) | 'all'
'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
FollowLinks
— Whether to follow links into library blocks
'off'
(default) | 'on'
'off'
does not allow you to follow links into
library blocks in a web view.
'on'
allows you to follow links into library blocks
in a web view.
Data Types: char
IncludeBehaviorComponents
— Whether to include behavior components
true
or
1
(default) | false
or 0
Whether to include behavior components defined in System Composer™ architecture models, specified as numeric or logical
0
(false
) or
1
(true
).
Data Types: logical
IncludeNotes
— Whether to include user notes
false
or
0
(default) | true
or 1
Whether to include user notes, specified as numeric or logical
0
(false
) or
1
(true
).
Data Types: logical
IncludeSupportingFunctions
— Whether to export supporting MATLAB® functions
false
or
0
(default) | true
or 1
Whether to export the MATLAB functions used in MATLAB Function blocks or
Stateflow charts to web view, specified as a numeric or logical
1
(true
) or
0
(false
).
Data Types: logical
FollowModelReference
— Whether to access referenced models in a web view
'off'
(default) | 'on'
'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
FollowSubsystemReference
— Whether to export referenced subsystems in a web view
"on"
(default) | "off"
Since R2024b
Whether to export referenced subsystems in a webview, specified as "on"
or "off"
. If true, the web view includes referenced subsystems. If false, the web view does not include referenced subsystems.
Data Types: string
RecurseFolder
— Whether to export models in subfolders
false (default) | true
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.
PackageName
— Name of the web view output package
model name (default)
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
PackageFolder
— Path of folder in which to place the packaged web view output
current working directory (default)
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
PackageType
— Type of web view output package
'both'
(default) | 'zipped'
| 'unzipped'
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
OptionalViews
— Optional views to include
{}
(default) | cell array
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.
ViewFile
— Whether to display the web view in a web browser when you export the web view
true
(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: logical
ShowProgressBar
— Whether to display the status bar when you export a web view
true
(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: logical
IncrementalExport
— Option to export model incrementally
false
(default) | 0
| true
| 1
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 ranslwebview
.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
filename
— The name of the HTML file for displaying the web view
string
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.
Note
When using color to differentiate sample times, only the colors for referenced models will be visible in the web view. Colors applied to referenced subsystems are not supported.
Version History
Introduced in R2006aR2024b: Option to exclude referenced subsystems in web view
When generating a model web view, choose whether or not to include referenced subsystems
by using the propertyFollowSubsystemReference
. The default behavior is to
include referenced subsystems in the model web view.
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)