Access Code of Stateflow States via find_system

1 visualización (últimos 30 días)
Lars Schürmann
Lars Schürmann el 5 de Ag. de 2014
Respondida: Lars Schürmann el 6 de Ag. de 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

Respuestas (1)

Lars Schürmann
Lars Schürmann el 6 de Ag. de 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

Categorías

Más información sobre Complex Logic en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by