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 Data Types for more information.
Simulink blocks can output one-dimensional, two-dimensional, or multidimensional signals. The Simulink user interface and documentation generally refer to 1-D signals as vectors and 2-D or multidimensional signals as matrices. A one-element array is frequently referred to as a scalar.
The size of a signal refers to the number of elements that a signal contains. The size of a matrix (2-D) signal is generally expressed as M-by-N, where M is the number of columns and N is the number of rows making up the signal. The size of a vector signal is referred to as the width of the signal.
For more information, see Signal Dimensions.
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:
Load complex-valued signal data from the MATLAB workspace into the model via a root-level Inport block.
Create a Constant block in your model and set its value to a complex number.
Create real signals corresponding to the real and imaginary parts of a complex signal, then combine the parts into a complex signal, using the Real-Imag to Complex conversion block.
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.
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|
You can specify the non-default initial values of signals for Simulink to use at the beginning of simulation.
For any signal, you can define a signal object (
Simulink.Signal), and use that signal
object to specify an initial value for the signal.
For details, see Initialize Signals and Discrete States.
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 View Simulation Results. For detailed information about:
To include graphical displays of signal values in a model diagram, use one of the following approaches:
For many blocks, Simulink can display block output (port values) as data tips on the block diagram while a simulation is running.
In the Simulink Editor, select Display > Data Display in Simulation.
From the submenu, select either Show Value Labels When Hovering or Show Value Labels When Clicked.
To change display options, use the Options submenu.
For details, see Display Port Values for Debugging.
To display, below a specific signal, the signal value after simulation:
Right-click the signal.
In the context menu, select Show Value Label of Selected Port.
You can save signal values to the MATLAB workspace during simulation, for later retrieval and postprocessing. For a summary of different approaches, see Approaches for Exporting Signal Data.