How can I access Simulink/Stateflow chartFileNumber from within a Matlab function?
Show older comments
A typical Simulink model file (mdl) with a Stateflow chart looks something like
[..]
Stateflow {
machine {
[..]
}
chart {
[..]
chartFileNumber 1
[..]
}
[..]
}
The contained Stateflow charts have a chartFileNumber property.
I can get access to the Statemachine and Chart objects using the Simulink API.
SL = sfroot;
MDL = SL.find('-isa','Simulink.BlockDiagram');
ch = MDL.find('-isa','Stateflow.Chart'); % give the Chart object
But the chart object does not contain an element representing the chartFileNumber as stored in the mdl-file.
So: How can I access this counter from within an Matlab function (m-file)?
Regards, Jonatan Antoni
2 Comments
Kaustubha Govind
on 3 Jul 2012
Jonatan: Perhaps you can tell us a little bit about why you need to know that number? Since it is not part of the published API, I would recommend caution in attempting to have code that relies on it. (Personally, I don't know what the significance of that property is, but maybe someone else on this forum will know the answer).
Jonatan Antoni
on 3 Jul 2012
Answers (0)
Categories
Find more on Stateflow in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!