Using Simulink Previous page   Next Page

Logging Signals

Logging signals refers to the process of saving signal values to the MATLAB workspace during simulation for later retrieval and postprocessing. Simulink allows you to log a signal either by connecting the signal to a To Workspace, Scope block or viewer, or root-level Outport block or by setting the signal's signal logging properties. The first method allows you to document in the diagram itself the workspace variables used to store signal data. The second method reduces diagram clutter by eliminating the need to use blocks to log signals. Either method allows you to specify the names of the workspace variables used to save signal data and to limit the amount of data logged for a particular signal.

See the documentation for the To Workspace and Outport blocks for information on using these blocks to log signal data. The remainder of this section explains how to use signal properties to log and access signal data.

Enabling Signal Logging

To enable signal logging for a signal, select the Log signal data option on the signal's Signal Properties dialog box (see Signal Properties Dialog Box).

Globally Enabling and Disabling Signal Logging

You can globally enable or disable signal logging for a model by checking or unchecking the Signal logging option on the Data Import/Export pane of the Configuration Parameters dialog box (see Signal logging). Simulink logs signals only if this option is checked. If the option is not checked, Simulink ignores the signal logging settings for individual signals.

Specifying a Logging Name

You can assign a name, called the logging name, to the object used to log data for a signal during simulation. If the signal to be logged does not have a name or is an element of a composite signal that has another element of the same name, you must specify a unique log name for the signal. To specify a log name for a signal, select Custom from the Logging name list on the signal's Signal Properties dialog box and enter the custom name in the adjacent text field. If a signal has a name you do not need to specify a logging name for the signal, Simulink uses the signal's name as its logging name.

Limiting the Data Logged for a Signal

The Data panel of the Signal Properties dialog box lets you limit the amount of data logged for a signal. For example, you can specify the maximum amount of data to be logged for a signal or a decimation factor that causes Simulink to skip a specified number of time steps before logging a signal value. See Data for more information.


Previous page  The Signal Selector Logging Referenced Model Signals Next page

© 1994-2005 The MathWorks, Inc.