| Simulink Reference | ![]() |
Create an input port for a subsystem or an external input
Library
Description
Inport blocks are the links from outside a system into the system.
Simulink assigns Inport block port numbers according to these rules:
You can specify the dimensions of the input to the Inport block using the Port dimensions parameter, or let Simulink determine it automatically by providing a value of -1.
The Sample time parameter is the rate at which the signal is coming into the system. The value of -1 causes the block to inherit its sample time from the block driving it. It might be appropriate to set this parameter for Inport blocks in the top-level system or in models where Inport blocks are driven by blocks whose sample times cannot be determined. See Specifying Sample Time in the online documentation for more information.
Inport Blocks in a Subsystem
Inport blocks in a subsystem represent inputs to the subsystem. A signal arriving at an input port on a Subsystem block flows out of the associated Inport block in that subsystem. The Inport block associated with an input port on a Subsystem block is the block whose Port number parameter matches the relative position of the input port on the Subsystem block. For example, the Inport block whose Port number parameter is 1 gets its signal from the block connected to the topmost port on the Subsystem block.
If you renumber the Port number of an Inport block, the block becomes connected to a different input port, although the block continues to receive its signal from the same block outside the subsystem.
The Inport block name appears in the Subsystem icon as a port label. To suppress display of the label, select the Inport block, choose Hide Name from the Format menu, then choose Update Diagram from the Edit menu.
Inport Blocks in a Top-Level System
Inport blocks in a top-level system have two uses: to supply external inputs from 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 perturb the model.
ut argument of the sim command (see sim) to specify the inputs.
linmod and trim analysis functions. Inport blocks define the points where inputs are injected into the system. For information about using Inport blocks with analysis commands, see Analyzing Simulation Results in the Using Simulink documentation.
Creating Duplicate Inports
You can create any number of duplicates of an Inport block. The duplicates are graphical representations of the original intended to simplify block diagrams by eliminating unnecessary lines. The duplicate has the same port number, properties, and output as the original. Changing a duplicate's properties changes the original's properties and vice versa.
To create a duplicate of an Inport block,
Data Type Support
The Inport block accepts complex or real signals of any data type supported by Simulink, including fixed-point data types. For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.
The numeric and data types of the block's output are the same as those of its input. You can specify the signal type, data type, and sampling mode of an external input to a root-level Inport block using the Signal type, Data type, and Sampling mode parameters.
The elements of a signal array connected to a root-level Inport block must be of the same numeric and data types. Signal elements connected to a subsystem inport can be of differing numeric and data types except in the following circumstance: If the subsystem contains an Enable or Trigger block or is an Atomic Subsystem and the inport, or an element of the inport, is connected directly to an outport, the input elements must be of the same type. For example, consider the follow enabled subsystem.
In this example, the elements of a signal vector connected to In1 must be of the same type. The elements connected to In2, however, can be of differing types.
Parameters and Dialog Box
The Main pane of the Inport block dialog appears as follows:
The Signal specification pane of the Inport block dialog appears as follows:
Simulink.Bus class in the online documentation to learn how to create bus objects).
-1 |
Dimensions are inherited from input signal |
n |
Vector signal of width n accepted |
[m n] |
Matrix signal having m rows and n columns accepted |
auto.
Specify via dialog for the Data type parameter.
Specify via dialog for the Data type parameter.
real or complex) of the external input. To accept either type, set this parameter to auto.
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 |
Specified in the Sample time parameter |
| Dimensionalized |
Yes |
| Index Vector | Integer Delay | ![]() |
© 1994-2005 The MathWorks, Inc.