Import Signal Logging Data

You can log signal data from a simulation, and then import that data into a model. For more information about signal logging, see Export Signal Data Using Signal Logging.

The imported signal logging data provides the input for simulating the model. You can use imported signal logging data to perform standalone simulation of a referenced model.

  1. Set the Configuration Parameters > Data Import/Export > Signal logging format parameter to Dataset.

  2. Use the default signal logging output variable, logsout, or specify a variable using the Configuration Parameters > Data Import/Export > Signal logging edit box.

  3. Simulate the parent model.

    The signal logging output is a Simulink.SimulationData.Dataset object.

  4. Use the Simulink.SimulationData.Dataset.getElement method to access the logged data. The logging data for individual signals is stored in Simulink.SimulationData.Signal objects.

  5. For the referenced model that you want to simulate standalone, use the Simulink.SimulationData.Signal.getElement method to specify signal elements for the Configuration Parameters > Data Import/Export > Input parameter.

    For example:

  6. Simulate the referenced model.

For an example of loading logged signal data into a model:

  1. Open the sldemo_mdlref_bussldemo_mdlref_bus model.

  2. In the right corner of the model, double-click the left question mark block.

  3. See the "Logging Model Reference Signals" and "Loading Data" sections.

To import signal logging data for array of buses signals, see Import Array of Buses Data.

Was this topic helpful?