| Simulink® | ![]() |
| On this page… |
|---|
The term signal refers to a time varying quantity that has values at all points in time. You can specify a wide range of signal attributes, including signal name, data type (e.g., 8-bit, 16-bit, or 32-bit integer), numeric type (real or complex), and dimensionality (one-dimensional, two-dimensional, or multidimensional array). Many blocks can accept or output signals of any data or numeric type and dimensionality. Others impose restrictions on the attributes of the signals they can handle.
Simulink defines signals as the outputs of dynamic systems represented by blocks in a Simulink diagram and by the diagram itself. The lines in a block diagram represent mathematical relationships among the signals defined by the block diagram. For example, a line connecting the output of block A to the input of block B indicates that the signal output by B depends on the signal output by A.
On the block diagram, signals are represented with lines that have an arrowhead. The source of the signal corresponds to the block that writes to the signal during evaluation of its block methods (equations). The destinations of the signal are blocks that read the signal during the evaluation of the block's methods (equations).
Note It is tempting but misleading to think of Simulink signals as traveling along the lines that connect blocks the way electrical signals travel along a telephone wire. This analogy is misleading because it suggests that a block diagram represents physical connections between blocks, which is not the case. Simulink signals are mathematical, not physical, entities and the lines in a block diagram represent mathematical, not physical, relationships among blocks. |
You can create signals by creating source blocks in your model. For example, you can create a signal that varies sinusoidally with time by dragging an instance of the Sine block from the Simulink Sources library into the model. See Sources for information on blocks that you can use to create signals in a model. You can also use the Signal & Scope Manager to create signals in your model without using blocks. See Introducing the Signal and Scope Manager for more information.
You can give any signal a name. The syntactic requirements for a signal name vary depending on how the name will be used. The three most common cases are:
The signal is named so that it can be resolved to a Simulink.Signal object. (See Simulink.Signal.) The signal name must then be a legal MATLAB identifier. Such an identifier starts with an alphabetic character, followed by alphanumeric or underscore characters up to the length given by the function namelengthmax.
The signal has a name so the signal can be identified and referenced by name in a data log. (See Logging Signals.) Such a signal name can contain space and newline characters. These can improve readability but sometimes require special handling techniques, as described in Handling Spaces and Newlines in Logged Names.
The signal name exists only to clarify the diagram, and has no computational significance. Such a signal name can contain anything and never needs special handling.
To avoid any doubt about whether a signal name will serve all present and future purposes, make every signal name a legal MATLAB identifier. Otherwise, unexpected requirements may require going back and changing signal names to follow a more restrictive syntax. You can use the function isvarname to determine whether a signal name is a legal MATLAB identifier.
To assign a name to a signal, double-click the signal. An edit box appears next to the signal near where you double-clicked. Enter the desired name, then click somewhere outside the edit box. The signal now has the specified name, and a label showing that name appears at the location where you entered it. For a named multibranched signal, you can put a duplicate label on any branch of the signal by double-clicking the branch.
Another way to name a signal is to right-click the signal, choose Signal Properties from the Context menu, enter a name in the Signal Name field, then click OK or Apply. A label showing the name then appears on every branch of the signal. See Signal Properties Dialog Box for more information.
You can also use the API to set the name parameter of the port or line that represents the signal:
p = get_param(gcb, 'PortHandles') l = get_param(p.Inport, 'Line') set_param(l, 'Name', 's9')
To change the name of a signal, click to set the cursor in any label that shows the name, than change the text as needed; or edit the name in the Signal Properties > Signal Name field. All labels automatically update to reflect the change.
To change the location of a label that displays a signal name, drag it with the mouse. You cannot drag a label away from its signal, but only to a different location adjacent to the signal.
To delete a signal's name, leaving it nameless, delete all characters in the name, in any label on the signal or in the Signal Properties > Signal Name field. To delete a label without deleting the signal name, click near the edge of the label to select its surrounding box, then press Delete. The label disappears, but the signal name itself is unaffected.
As with creating signals, you can use either blocks or 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. See Sinks in the Simulink block reference for information on blocks that you can use to display signals in a model.
Simulink uses a variety of line styles to display different types of signals in the model window. Assorted line styles help you to differentiate the signal types in Simulink diagrams. The signal types and their line styles are as follows:
| Signal Type | Line Style | Description |
|---|---|---|
| Scalar and Nonscalar |
| Simulink uses a thin, solid line to represent a diagram's scalar and nonscalar signals. |
| Nonscalar |
| When the Wide nonscalar lines option is enabled, Simulink uses a thick, solid line to represent a diagram's nonscalar signals. See also Using Muxes. |
| Control |
| Simulink uses a thin, dash-dot line to represent a diagram's control signals. |
| Virtual Bus |
| Simulink uses a triple line with a solid core to represent a diagram's virtual signal buses. See Using Buses. |
| Nonvirtual Bus |
| Simulink uses a triple line with a dotted core to represent a diagram's nonvirtual signal buses. See Using Buses. |
Other than using the Wide nonscalar lines option to display nonscalar signals as thick, solid lines, you cannot customize or control the line style with which Simulink displays signals. See Wide Nonscalar Lines for more information about this option.
Note As you construct a block diagram, Simulink uses a thin, solid line to represent all signal types. The lines are then redrawn using the specified line styles only after you update or start simulation of the block diagram. |
A signal label is text that appears next to the line that represents a signal that has a name. The signal label displays the signal's name. In addition, if the signal is a virtual signal (see Virtual Signals) and its Show propagated signals property is on (see Show propagated signals), the label displays the names of the signals that make up the virtual signal.
Simulink creates a label for a signal when you assign it a name in the Signal Properties Dialog Box. You can change the signal's name by editing its label on the block diagram. To edit the label, left-click the label. Simulink replaces the label with an edit field. Edit the name in the edit field, then click outside the label to apply the change.
A signal's label displays the signal's name. A virtual signal's label optionally displays the signals it represents in angle brackets. You can edit a signal's label, thereby changing the signal's name.
To create a signal label (and thereby name the signal), double-click the line that represents the signal. The text cursor appears. Enter the name and click anywhere outside the label to exit label editing mode.
Note When you create a signal label, take care to double-click the line. If you click in an unoccupied area close to the line, you will create a model annotation instead. |
Labels can appear above or below horizontal lines or line segments, and left or right of vertical lines or line segments. Labels can appear at either end, at the center, or in any combination of these locations.
To move a signal label, drag the label to a new location on the line. When you release the mouse button, the label fixes its position near the line.
To copy a signal label, hold down the Ctrl key while dragging the label to another location on the line. When you release the mouse button, the label appears in both the original and the new locations.
To edit an existing signal label, select it:
To replace the label, click the label, double-click or drag the cursor to select the entire label, then enter the new label.
To insert characters, click between two characters to position the insertion point, then insert text.
To replace characters, drag the mouse to select a range of text to replace, then enter the new text.
To delete all occurrences of a signal label, delete all the characters in the label. When you click outside the label, the labels are deleted. To delete a single occurrence of the label, hold down the Shift key while you select the label, then press the Delete or Backspace key.
To change the font of a signal label, select the signal, choose Font from the Format menu, then select a font from the Set Font dialog box.
Data type refers to the format used to represent signal values internally. The data type of Simulink signals is double by default. However, you can create signals of other data types. Simulink supports the same range of data types as MATLAB. See Working with Data Types for more information.
Simulink blocks can output one-, two-, or multidimensional signals. A one-dimensional (1-D) signal consists of a stream of one-dimensional arrays output at a frequency of one array (vector) per simulation time step. A two-dimensional (2-D) signal consists of a stream of two-dimensional arrays output at a frequency of one 2-D array (matrix) per block sample time. A multidimensional signal consists of a stream of multidimensional (2 or more dimensions) arrays output at a frequency of one array per block sample time (see Multidimensional Arrays in the MATLAB Programming Fundamentals documentation for information on multidimensional arrays). 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. A row vector is a 2-D array that has one row. A column vector is a 2-D array that has one column.
Only the following Simulink blocks support multidimensional signals. Simulink supports signals with up to 32 dimensions. Do not use signals with more than 32 dimensions.
Gain (only if the Multiplication parameter specifies Element-wise(K.*u))
Math Function (no multidimensional signal support for the transpose and hermitian functions)
Product, Product of Elements — only if the Multiplication parameter specifies Element-wise(.*)
Add, Subtract, Sum, Sum of Elements — along specified dimension
Simulink blocks vary in the dimensionality of the signals they can accept or output. Some blocks can accept or output signals of any dimensions. Some can accept or output only scalar or vector signals. To determine the signal dimensionality of a particular block, see the block's description in Blocks — Alphabetical List in the online Simulink reference. See Determining Output Signal Dimensions for information on what determines the dimensions of output signals for blocks that can output nonscalar signals.
Note Simulink does not support dynamic signal dimensions during simulation. That is, the size of a signal must remain constant while the simulation executes. You can alter a signal's size only after terminating the simulation. |
The values of Simulink signals can be complex numbers. A signal whose values are complex numbers is called a complex signal. You can introduce a complex-valued signal into a model in the following ways:
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.
You can 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 in Blocks — Alphabetical List in the online Simulink reference.
A virtual signal is a signal that graphically represents other signals or parts of other signals. Virtual signals are purely graphical entities; they have no mathematical or physical significance. Simulink ignores them when simulating a model, and they do not exist in generated code. Some blocks, such as the Mux block, always generate virtual signals. Others, such as Bus Creator, can generate either virtual or nonvirtual signals.
The nonvirtual components of a virtual signal are called regions. A virtual signal can contain the same region more than once. For example, if the same nonvirtual signal is connected to two input ports of a Mux block, the block outputs a virtual signal that has two regions. The regions behave as they would if they had originated in two different nonvirtual signals, even though the resulting behavior duplicates information.
Whenever you update or run a model, Simulink determines the nonvirtual signal(s) represented by the model's virtual signal(s), using a procedure known as signal propagation. When running the model, Simulink uses the corresponding nonvirtual signal(s), determined via signal propagation, to drive the blocks to which the virtual signals are connected.
Consider, for example, the following model.

The signals driving Gain blocks G1 and G2 are virtual signals corresponding to signals s2 and s1, respectively. Simulink determines this automatically whenever you update or simulate the model.
The Show propagated signals option (see Signal Properties Dialog Box) displays the nonvirtual signals represented by virtual signals in the labels of the virtual signals.

When you change the name of a nonvirtual signal, Simulink immediately updates the labels of all virtual signals that represent the nonvirtual signal and whose Show propagated signals is on, except if the path from the nonvirtual signal to the virtual signal includes an unresolved reference to a library block. In such cases, to avoid time-consuming library reference resolutions while you are editing a block diagram, Simulink defers updating the virtual signal's label until you update the model's block diagram either directly (e.g., by pressing Ctrl+D) or by simulating the model.
Note Virtual signals can represent virtual as well as nonvirtual signals. For example, you can use a Bus Creator block to combine multiple virtual and nonvirtual signals into a single virtual signal. If during signal propagation, Simulink determines that a component of a virtual signal is itself virtual, Simulink uses signal propagation to determine the nonvirtual components of the virtual component. This process continues until Simulink has determined all nonvirtual components of a virtual signal. |
To display the signal(s) represented by a virtual signal, right-click the signal line and select Signal Properties. The Signal Properties dialog box (see Signal Properties Dialog Box) is displayed. Select the Show propagated signals check box, then click OK. Simulink displays the signals represented by the virtual signal in brackets in the label. After you select the Show propagated signals check box, you can provide a signal name. As a shortcut, you can also click the signal's label, clear the name (if one exists) and enter an angle bracket (<). Click anywhere outside the signal's label. Simulink exits label editing mode and displays the signals represented by the virtual signal in brackets in the label. After you enable the Show propagated signals parameter, you can enter a signal name in the label.
A Simulink mux is a virtual signal that graphically combines two or more vector signals into one signal line. A Simulink mux should not be confused with a hardware multiplexer, which combines multiple data streams into a single channel. A Simulink mux does not combine signals in any functional sense: it exists only virtually, and has no purpose except to simplify a model's visual appearance. Using a mux has no effect on simulation or generated code.
You can use a mux anywhere that you could use an ordinary (contiguous) vector, including performing calculations on it. The computation affects each constituent value in the mux just as if the values existed in a contiguous vector, and the result is a contiguous vector, not a mux. Models can use this capability to perform computations on multiple vectors without the overhead of first copying the separate values to contiguous storage.
The Simulink documentation refers, sometimes interchangeably, to "muxes", "vectors", and "wide signals", and all three terms appear in Simulink GUI labels and API names. This terminology can be confusing, because most vector signals, which are also called wide signals, are nonvirtual and hence are not muxes. To avoid confusion, reserve the term "mux" to refer specifically to a virtual vector.
A mux is, by definition, a virtual vector signal: its constituent signals retain their separate existence in every way except visually. You can also combine scalar and vector signals into a nonvirtual vector signal, by using a Vector Concatenate block. The signal output by a Vector Concatenate block is an ordinary nonvirtual (contiguous) vector, inheriting no special properties from the fact that it was created from separate signals.
If you want to create a composite signal, in which the constituent signals retain their identities and can have different data types, use a Bus Creator block rather than a Mux block. Although you can use a Mux block to create a composite signal, The MathWorks discourages this practice. See Avoiding Mux/Bus Mixtures for more information.
The Signal Routing library provides two virtual blocks that you can use for implementing muxes:
Combine several input signals into a mux (virtual vector) signal
Extract and output the values in a mux (virtual vector) signal
To implement a mux signal:
Clone a Mux and Demux block from the Signal Routing library.
Set the Mux block's Number of inputs and the Demux block's Number of outputs properties to the desired values.
Connect the Mux, Demux, and other blocks as needed to implement the desired signal.
The next figure shows three signals that are input to a Mux block, transmitted as a mux signal to a Demux block, and output as separate signals.

The Mux and Demux blocks are the left and right vertical bars, respectively. Consistent with the goal of reducing visual complexity, neither block displays a name. The line connecting the blocks, representing the mux signal, is wide because the model has been built with Format > Port/Signal Displays > Wide Nonscalar Lines enabled in the model menu. See Displaying Signal Properties for details.
Signals input to a Mux block can any combination of scalars, vectors, and muxes. The signals in the output mux appear in the order in which they were input to the Mux block. You can use multiple Mux blocks to create a mux in several stages, but the result is flat, not hierarchical, just as if the constituent signals had been combined using a single mux block.
The values in all signals input to a Mux block must have the same data type. If they do not, the block will output a bus rather than a mux unless you have configured the model to disable this practice. The MathWorks discourages using Mux blocks to create buses. See Avoiding Mux/Bus Mixtures for details.
If a Demux block attempts to output more values than exist in the input signal, an error occurs. A Demux block can output fewer values than exist in the input mux, and can group the values it outputs into different scalars and vectors than were input to the Mux block, but it cannot rearrange the order of those values. See the Demux block documentation for details.
A Demux block can input a bus unless you have configured the model to disable this practice. The MathWorks discourages using Demux blocks to access buses under any circumstances. See Avoiding Mux/Bus Mixtures for details.
A control signal is a signal used by one block to initiate execution of another block, e.g., a function-call or action subsystem. When you update or start simulation of a block diagram, Simulink uses a dash-dot pattern to redraw lines representing the diagram's control signals as illustrated in the following example.

The Simulink software provides capabilities that you can use to group multiple signals into a hierarchical composite signal called a bus, route the bus from block to block, and extract constituent signals from the bus where needed. Buses can simplify the appearance of a model when many parallel signals exist, and help to clarify generated code. A bus can be either virtual or nonvirtual. See Using Composite Signals for details.
The following table summarizes the terminology used to describe signals in the Simulink user interface and documentation.
| Term | Meaning |
|---|---|
Bus | A Simulink composite signal |
Complex signal | Signal whose values are complex numbers. |
Composite Signal | A signal made up of other signals, optionally including other composite signals. See Using Composite Signals. |
Data type | Format used to represent signal values internally. See Working with Data Types. |
Matrix | Two-dimensional signal array. |
Mux | A virtual vector created with a Mux block. |
Real signal | Signal whose values are real (as opposed to complex) numbers. |
Scalar | One-element array. |
Signal bus | Same as a composite signal |
Signal propagation | Process used by the Simulink to determine attributes of signals and blocks, such as data types, labels, sample time, dimensionality, and so on, that are determined by connectivity. |
Size | 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. |
Test point | A signal that must be accessible during simulation. See Working with Test Points for more information. |
Vector | One-dimensional signal array. |
Virtual signal | Signal that represents another signal or set of signals. |
Width | Size of a vector signal. |
![]() | Working with Signals | Validating Signal Connections | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |