New Stateflow MATLAB chart: can it be created from a "regular" chart?

I have a question regarding the MATLAB charts that have now been introduced in R2012B. Is it possible to convert a regular (old) stateflow chart into a MATLAB chart that accepts MATLAB expressions in action language? I have old charts in which I used expressions such as busy_time=ml('max(min((300+100*randn(1)),800),30)') which I think can be simplified if the ml('') is removed...
I couldn't find this in the manual...

 채택된 답변

Siddharth
Siddharth 2012년 10월 17일

0 개 추천

Currently, the only option is to copy the contents of the C chart block to the MATLAB chart block and redefine the variables. Some things to keep in mind as you manually change the langauge in the charts:

추가 답변 (1개)

Siddharth
Siddharth 2012년 10월 16일
편집: Siddharth 2012년 10월 18일

0 개 추천

Hi Wilfred,
There is no direct way to convert the action language from C to MATLAB in a state diagram currently as far as I know.
This seems like something that many existing users who want to use MATLAB as the action language in Stateflow can possibly benefit from. Please create an enhancement request for this through technical support.
Thanks, Siddharth

댓글 수: 1

Thank you, Siddharth.
So you are saying that the 'old' action language is actually C? I didn't realize that. Indeed it would be nice to have automatic conversion as you are suggesting, but it would already be an improvement if it would be possible to redefine an existing 'old' stateflow chart as a Matlab stateflow chart, and then simplify the action-language statements manually. That was what I was thinking of, and it is not described in the manual.
Perhaps it is also possible to copy-paste the contents of an 'old' stateflow chart into a Matlab stateflow chart (I haven't tried that yet) but that would, in addition, require redefining of all the variables in the chart....

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Stateflow에 대해 자세히 알아보기

제품

질문:

2012년 9월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by