필터 지우기
필터 지우기

How to add Inputs/Outputs to Stateflow by code

조회 수: 7 (최근 30일)
Camba
Camba 2016년 5월 31일
답변: Camba 2016년 6월 2일
I want to add an input to a Stateflow chart by code.
The way to do it without code is to go to tools/model explorer, click the add data button and choose the scope to be an input.
How do I do it by code?
The way I am currently doing is adding an IN port from matlab with the add_block function, but when I do it this way the port does not show in the model explorer. Is this a bug or is there another way to do it by code that adds the variable to the model explorer?

채택된 답변

Camba
Camba 2016년 6월 2일
Problem solved. I did it by getting a handle to a state or chart. For example:
ch = sfgco; data = Stateflow.Data(ch); data.Scope = 'Input';

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by