Main Content

Create and Use a Web View

About This Tutorial

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.

Export Specific Systems

When you create the Web view, you can specify export options.

  1. At the MATLAB® command prompt, enter sldemo_auto_climatecontrol to open the Simulink model.

  2. In the Simulink Toolstrip, on the Simulation tab, in the File section, click Save . Under Export Model To, select Web View.

  3. In the Include Options, select Masked Subsystems. This enables users of the Web view to interact with masked blocks.

  4. In Systems to Exclude, select Temperature Control Chart.

  5. Use the Folder edit box to specify climate_control_webview as the name for the zip file for the exported Web view files.

  6. 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.

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

Navigate the Web View

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:

  1. 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.

  2. Open the model browser (hidden by default). Click Hide/Show Model Browser .

  3. Open another system, in a separate tab. In the model browser, CTRL+click select the Heater Control system.

  4. 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.

  5. Zoom the display with the mouse scroll wheel.

Display Parameters and Properties of Blocks and Signals

  1. In the model browser, select sldemo_auto_climatecontrol.

  2. Double-click the AC Control subsystem.

  3. 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.

  4. Click the input signal for the Exit Temp (AC) block to display the signal properties.

    Try navigating to other parts of the web view.

  5. Close the web view.

Open 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.

Related Examples

More About