Main Content

getEntityPortsImpl

Class:matlab.DiscreteEventSystem
Package:matlab

Define input ports and output ports of discrete-event system

Syntax

[inputTypes,outputTypes]=getEntityPortsImpl(obj)

Description

[inputTypes,outputTypes]=getEntityPortsImpl(obj)defines input ports and output ports of a discrete-event system.

Input Arguments

expand all

Discrete-event System object.

Output Arguments

expand all

Input port types of a discrete-event system, specified as a cell vector of character vectors with a length that is the same as the number of input ports.

TheNth element of the vector that specifies the type of theNth input port.

  • If the port is an entity port, the character vector indicates the entity type name of this port. The name must match one of the entity types specified ingetEntityTypesImpl.

  • If the port is a signal port, the character vector must be empty ('').

Output port types of a discrete-event system, specified as a cell vector with a length that is the same as the number of output ports.

TheNth element of the vector that specifies type of theNth output port.

  • If the port is an entity port, the character vector indicates the entity type name of this port. The name must match one of the entity types specified ingetEntityTypesImpl.

  • If the port is a signal port, the character vector must be empty ('').

Examples

expand all

Get entity input and output port types for discrete-event system.

function[inputTypes,outputTypes] = getEntityPortsImpl(obj)% Specify input and output port types.%% This implementation further specifies port type and entity% type at these inputs and outputs:% Inputs:% 1. Signal port% 2. Entity port receiving entities of type 'entity1'% 3. Entity port receiving entities of type 'entity2'% Outputs:% 1. Signal port% 2. Entity port sending entities of type 'entity2'%% The discrete-event system must have already defined:% - 3 inputs (by method 'getNumInputsImpl') and% - 2 outputs (by method 'getNumOutputsImpl')inputTypes = {'','entity1','entity2'}; outputTypes = {'','entity2'};end

版本历史

Introduced in R2016a