Contenu principal

Simulink.sdi.loadView

R2026b

Load a view file to visualize data in the Simulation Data Inspector

Description

Simulink.sdi.loadView(filename) applies the visualization information in the view file, filename, to the data in the Simulation Data Inspector.

A view contains information about the layouts and plots in the graphical viewing area across all tabs (since R2026b), as well as properties of plotted signals. When you load a view, the Simulation Data Inspector uses the properties and preferences in the file to display data currently in the Simulation Data Inspector. Signals in the Simulation Data Inspector align with the signals in the view according to these properties, in order:

  1. Block path

  2. Signal ID

  3. Signal name

Aligned signals are plotted in the graphical viewing area. Use a view to apply a consistent set of visualization settings to multiple sets of similar data.

The view file includes the following information:

  • Tabs, subplot layouts, and visualization types

  • Settings for each visualization type in the layout

  • Signal selection mode

  • Replay controls visibility

  • Metadata displayed in the work area

  • Settings for signal grouping in the work area

  • Plotted signals and the line style and color for each plotted signal

Before R2026b: When you load a session file that contains multiple tabs, the Simulation Data Inspector loads only the view from the tab that was active when the session was saved.

Note

Log or import data into the Simulation Data Inspector before loading a saved view. The software applies a saved view only if the Simulation Data Inspector contains signals that align with the view. If there are no matching signals, the view is not applied and any new logged or imported signals do not inherit the visualization settings in the saved view.

A view file does not contain data. To load a session file that contains data and visualization information, use the Simulink.sdi.load function.

example

Examples

collapse all

Apply previously saved visualization settings to simulation data in the Simulation Data Inspector. The view aligns signals by block path, signal ID, or signal name and applies the saved subplot layout, line styles, and colors.

Run a simulation to log data to the Simulation Data Inspector.

out = sim("myModel");

Apply visualization settings to the logged data.

Simulink.sdi.loadView("myView.mldatx")

Input Arguments

collapse all

Name of the view file, specified as a string or character vector. When the view file is on the MATLAB® path, you can specify filename as only the file name. When the view file is not on the path, specify a full path to the file.

Example: "myView.mldatx"

Data Types: char | string

Version History

Introduced in R2019b