Investigate Signal Values - MATLAB & Simulink (original) (raw)

While transmitting valuable data about a model and between the blocks, signals may take different values. In this section, you learn how to initialize, display signals as well as more information on the data types and dimensions a signal can take.

Initialize Signal Values

If a signal does not have an explicit initial value, the initial value that SimulinkĀ® uses depends on the data type of the signal.

Signal Data Type Default Initial Value
Numeric (other than fixed-point) Zero
Fixed-point Real-world ground value
Boolean False
Enumerated Default value

You can specify the non-default initial values of signals for Simulink to use at the beginning of simulation.

For details, see Initialize Signals and Discrete States.

View Signal Values

You can use either blocks or the signal viewers (such as the Signal & Scope Manager) to display the values of signals during a simulation. For example, you can use either the Scope block or the Signal & Scope Manager to graph time-varying signals on an oscilloscope-like display during simulation. For general information about options for viewing signal values, see Scope Blocks and Scope Viewer Overview. For detailed information about:

Display Signal Values in Model Diagrams

To include graphical displays of signal values in a model diagram, use one of the following approaches:

Display Data Tips During Simulation

For many blocks, Simulink can display block output (port values) as data tips on the block diagram while a simulation is running.

  1. In the Simulink Editor, on the Debug tab, select Output Values , go to the tab, and toggle on the > button.
  2. To change display options, use the submenu.

For details, see View Signal Values Using Port Value Labels.

Display Signal Value After Simulation

To display, below a specific signal, the signal value after simulation:

  1. Right-click the signal.
  2. In the context menu, select .

Signal Data Types

Data type refers to the format used to represent signal values internally. By default, the data type of Simulink signals is double. You can create signals of other data types. Simulink signals support the same range of data types as MATLABĀ®. See About Data Types in Simulink for more information.

Complex Signals

The values of signals can be complex numbers or real numbers. A signal whose values are complex numbers is a complex signal. Create a complex-valued signal using one of the following approaches:

Manipulate complex signals via blocks that accept them. If you are not sure whether a block accepts complex signals, see the documentation for the block.

Exporting Signal Data

You can save signal values to the MATLAB workspace during simulation, for later retrieval and postprocessing. For a summary of different approaches, see Save Simulation Data.

See Also

Topics