Access Code of Stateflow States via find_system

1 Ansicht (letzte 30 Tage)
Lars Schürmann
Lars Schürmann am 5 Aug. 2014
Beantwortet: Lars Schürmann am 6 Aug. 2014
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

Antworten (1)

Lars Schürmann
Lars Schürmann am 6 Aug. 2014
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

Kategorien

Mehr zu Complex Logic finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by