Access Code of Stateflow States via find_system

1 回表示 (過去 30 日間)
Lars Schürmann
Lars Schürmann 2014 年 8 月 5 日
回答済み: Lars Schürmann 2014 年 8 月 6 日
Hey,
I am trying to find out if/how I can access the content of states that I've got inside of a Stateflow Chart (I'd like to get access to the code to check some syntax errors) from within MATLAB.
I already tryed to access the states via find_system('myModel','FindAll', 'on','MaskType','Stateflow') which gives me the Chart, but from there on I've got no Idea how to access the code within the States in that Chart.
Would be awesome if somebody could help me.
Kind regards, Lars

回答 (1 件)

Lars Schürmann
Lars Schürmann 2014 年 8 月 6 日
For everybody who cares... This is how I did it now...
model = rt.find('-isa', 'Simulink.BlockDiagram', '-and', 'Name', 'myModel'); chart = model.find('-isa','Stateflow.Chart'); states = find(ch, '-isa','Stateflow.State');
for i=1:length(states) text = states(i).Label; %contains text of each of the states end

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by