I have a Simulink model with a subsystem named PPModel that contains a Stateflow chart named Chart. The following commands give different results in Stateflow 6.1 (R14SP1) as compared to Stateflow 6.0 (R14).
In Stateflow 6.1 (R14SP1) the Chart variable is returned as empty:
ModelName='errTest';rt=sfroot;m=rt.find('-isa','Stateflow.Machine','-and','Name',ModelName)compName='PPModel/Chart';chart=m.find('-isa','Stateflow.Chart','-and','Name',compName) chart = handle: 0-by-1
In Stateflow 6.0 (R14), with the same code, the chart variable is returned as follows:
chart = Path: 'errTest/PPModel/Chart' Id: 18 Machine: [1x1 Stateflow.Machine] Name: 'PPModel/Chart' Description: '' Dirty: 0 Locked: 0 Iced: 0 Document: '' Tag: [] StateColor: [0 0 0] StateLabelColor: [0 0 0] TransitionColor: [0.2902 0.3294 0.6039] TransitionLabelColor: [0.2902 0.3294 0.6039] JunctionColor: [0.6824 0.3294 0] SelectionColor: [1 0 0.5176] ChartColor: [1 0.9608 0.8824] ErrorColor: [1 0 0] Visible: 0 ChartUpdate: 'Inherited' SampleTime: '' Debug: [1x1 Stateflow.ChartDebug] NoCodegenForCustomTargets: 0 ExportChartFunctions: 0 ExecuteAtInitialization: 0 StrongDataTypingWithSimulink: 1 RequirementInfo: '' EnableBitOps: 0 Editor: [1x1 Stateflow.Editor]
Best Answer