This tutorial takes you through the steps to export a Simulink® model to a Web view.
You create a Web view from the Simulink model window using the sldemo_auto_climatecontrol
model, which is provided with the Simulink software. This model simulates the working of an automatic climate
control system in a car.
When you create the Web view, you can specify export options.
At the MATLAB® command prompt, enter
sldemo_auto_climatecontrol
to open the Simulink model.
In the Simulink Toolstrip, on the Simulation tab, in the
File section, click Save
. Under Export Model
To, select Web View.
In the Include Options, select Masked Subsystems. This enables users of the Web view to interact with masked blocks.
In Systems to Exclude, select Temperature Control Chart.
Use the Folder edit box to specify
climate_control_webview
as the name for the zip file
for the exported Web view files.
Select the If package exists, increment name to prevent overwriting check box. Selecting this option prevents overwriting the Web view files if you export multiple Web views from the same model.
Click Export.
Exporting the selected systems to a Web view creates several support files, as well as an HTML file for displaying the systems. In this example, you change the defaults for the naming of the files.
The Web view files are exported, and the Web view appears in a Web browser.
The Temperature Control Chart appears in the top level of the model, but you cannot open that chart in the web view to see its contents.
By default, if you export a whole model to a Web view, the Model Viewer pane shows the whole model. You can display specific systems in the Web view. For example:
In the model viewer, double-click the AC Control subsystem.
The AC Control subsystem appears in the model viewer. The tab label reflects the name of the currently displayed subsystem.
Open the model browser (hidden by default). Click Hide/Show
Model Browser
.
Open another system, in a separate tab. In the model browser, CTRL+click select the Heater Control system.
Drag the AC Control system to the top of model viewer. Place the cursor in the display area, hold down the mouse scroll wheel, and drag.
Zoom the display with the mouse scroll wheel.
In the model browser, select
sldemo_auto_climatecontrol
.
Double-click the AC Control subsystem.
Click the Temp/enthalpy block to view the block parameter values. The Object Inspector pane groups the block parameters by the block parameter dialog box tabs.
Click the input signal for the Exit Temp (AC) block to display the signal properties.
Try navigating to other parts of the web view.
Close the web view.
In the MATLAB current folder (or wherever you saved the zip file when you performed
the steps in Export Specific Systems), extract the
climate_control_webview
zip file contents and open the
webview.html
file.