How to send an event with a MATLAB function (in Stateflow)

조회 수: 2 (최근 30일)
geieraffe
geieraffe 2014년 4월 7일
답변: Muthukumar Ganesan 2022년 8월 1일
Hey there, ...especially a warm welcome to all the Stateflow cracks,
I have a problem when implementing a functionality in Stateflow on two different ways: first one is implementing the whole functionality in Stateflow (with transition conditions, ...), second one is implementing it with a MATLAB function in Stateflow. ... whatever... what matters is how i can leave the states. I want to leave the states with an event.
With the "stateflow-method" I did it with adding a conditioned transition:
[Stop==1]
{send(myStopEvent,myState)}
But how can I send this event when implementing it with a MATLAB function? I tryed to use a flag:
du: [myReslut, stopFlag]=myMATLABfunction(...);
if stopFlag == 1
send(myStopEvent,myState)
end
But is this the only way? Are there nicer/ceaner ways to solve this problem?
Thanks for your suggestions!

답변 (1개)

Muthukumar Ganesan
Muthukumar Ganesan 2022년 8월 1일
Hi,
This can be done with a self transition. Please refer to the attachment for a reference.
Thanks.

카테고리

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