Using the 'Name' property would return the handles to the required objects directly.
Question
It is possible to obtain the handle to the currently visible Stateflow.Chart object by using the following command: >> s = sfroot; >> c = s.find('-isa', 'Stateflow.Chart', '-and', 'Visible', 1); What is the equivalent property for a Stateflow.Box object? The following command returns an empty 0x1 handle: >> b = s.find('-isa', 'Stateflow.Box', '-and', 'Visible', 1);
Expert Answer
Kshitij Singh
PhD Expert
Answered Aug 24, 2026
The command returns an empty handle because the Stateflow.Box constructor does not have a 'Visible' method. Hence, it would not be possible to programmatically query the currently visible Box object similar to how a Chart object is queried.
There are two possible ways in which this can be achieved:
1. If you are interested in programmatically querying and obtaining a handle to a currently visible Stateflow Object (chart, box, state etc.), click on the object-of-interest
and then use the 'sfgco' command.
2. If you are already aware about the names of the objects to be queried, then it is possible to directly filter these objects out by using their names:
>> c = s.find('-isa', 'Stateflow.Chart', '-and', 'Name', 'chart_name');
>> b = s.find('-isa', 'Stateflow.Box', '-and', 'Name', 'box_name');
Have a different question? Ask here
Related Stateflow Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →