Adding Enumeration to Interface Editor (2020B)

조회 수: 3 (최근 30일)
Jibu Palathanam
Jibu Palathanam 2021년 7월 30일
답변: Josh Kahn 2021년 9월 7일
I am using the System Composer in Matlab 2020b. I am adding interfaces for my ports. How can I add a Enumeration type Interface. When I try to add the "Type" for the element I cannot find "Enum" option. How I can I create a interface of type Enumeration

답변 (1개)

Josh Kahn
Josh Kahn 2021년 9월 7일
Hi Jibu,
Make sure that you have a valid Simulink enumeration type on your MATLAB path.
Then, in System Composer's interface editor, create an interface with at least one interface element. Open the property inspector then click on that element. You should be able to type something into the Type field. Type "Enum: myEnumName" and then when you assign that interface to ports, you can use Simulink to pass an enumeration through that interface.
lrc.m (example enum)
classdef lrc < Simulink.IntEnumType
% lrc Enumeration type definition for use with System Composer profile
enumeration
left(0)
right(1)
center(2)
end
end
Sample Architecture:
Simulink Behaviors:

카테고리

Help CenterFile Exchange에서 System Composer에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by