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 CenterFile Exchange에서 Complex Logic에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by