| Simulink Reference | ![]() |
Create an output port for a subsystem or an external output
Library
Description
Outport blocks are the links from a system to a destination outside the system.
Simulink assigns Outport block port numbers according to these rules:
Outport Blocks in a Subsystem
Outport blocks in a subsystem represent outputs from the subsystem. A signal arriving at an Outport block in a subsystem flows out of the associated output port on that Subsystem block. The Outport block associated with an output port on a Subsystem block is the block whose Port number parameter matches the relative position of the output port on the Subsystem block. For example, the Outport block whose Port number parameter is 1 sends its signal to the block connected to the topmost output port on the Subsystem block.
If you renumber the Port number of an Outport block, the block becomes connected to a different output port, although the block continues to send the signal to the same block outside the subsystem.
When you create a subsystem by selecting existing blocks, if more than one Outport block is included in the grouped blocks, Simulink automatically renumbers the ports on the blocks.
The Outport block name appears in the Subsystem icon as a port label. To suppress display of the label, select the Outport block and choose Hide Name from the Format menu.
Outport Blocks in a Conditionally Executed Subsystem
When an Outport block is in an enabled subsystem, you can specify what happens to its output when the subsystem is disabled: it can be reset to an initial value or held at its most recent value. The Output when disabled pop-up menu provides these options. The Initial output parameter is the value of the output before the subsystem executes and, if the reset option is chosen, while the subsystem is disabled.
Outport Blocks in a Top-Level System
Outport blocks in a top-level system have two uses: to supply external outputs to the workspace, which you can do by using either the Configuration Parameters dialog box or the sim command, and to provide a means for analysis functions to obtain output from the system.
sim command (see sim). For example, if a system has more than one Outport block and the save format is array, the following command
writes y as a matrix, with each column containing data for a different Outport block. The column order matches the order of the port numbers for the Outport blocks.
If you specify more than one variable name after the second (state) argument, data from each Outport block is written to a different variable. For example, if the system has two Outport blocks, to save data from Outport block 1 to speed and the data from Outport block 2 to dist, you could specify this command:
linmod and trim analysis functions to obtain output from the system (see Running a Simulation)
Data Type Support
The Outport block accepts complex or real signals of any data type supported by Simulink. An Outport block can also accept fixed-point data types if it is not a root-level outport. The complexity and data type of the block's output are the same as those of its input. For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.
The elements of a signal array connected to an Outport block can be of differing complexity and data types except in the following circumstance: If the outport is in a conditionally executed subsystem and the initial output is specified, all elements of an input array must be of the same complexity and data types.
Typical Simulink data type conversion rules apply to an outport's Initial output parameter. If the initial output value is in the range of the block's output data type, Simulink converts the initial output to the output data type. If the specified initial output is out of the range of the output data type, Simulink halts the simulation and signals an error.
Parameters and Dialog Box
The Main pane of the Outport block dialog appears as follows:
[] if your model does not depend on the initial output of the conditionally executed subsystem. Simulink does not allow the initial output of this block to be inf or NaN.
The Signal specification pane of the Output block dialog appears as follows:
Simulink.Bus class in the online documentation) to define the properties of a bus connected to this Outport block.
auto.
Specify via dialog for the Data type parameter.
Specify via dialog for the Data type parameter.
Sample based or Frame based) that the input signal must match. To accept any sampling mode, set this parameter to auto. This parameter is intended to support signal processing applications based on Simulink. See the documentation for the buffer function provided by the Signal Processing Toolbox or "Frame-Based Operations" in the documentation for the Signal Processing Blockset for information about frame-based signals.
Characteristics
| Sample Time |
Inherited from driving block |
| Dimensionalized |
Yes |
| Mux | Polynomial | ![]() |
© 1994-2005 The MathWorks, Inc.