matlabsimulinkstateflow

Search a Stateflow Chart or Transition by ID


I have the following warning in Stateflow with IDs of a Chart and a Transition.

Warning: Chart #404 has an unconditional transition #383 that shadows the following transitions: #381 . You can also configure the diagnostic by clicking here.

Is there a way find this Chart #404 or this Transition #383? Maybe a command similar to hilite_system? I tried with the Find window but it doesn't seem to work..


Solution

  • As mentioned by @am304, there should be a hyperlink (at least in the error/warning dialog that appears, if not the command line), but failing that, you can use the Stateflow API:

    >> rt = sfroot;  % Get the chart root
    >> t = rt.find('-isa','Stateflow.Transition','Id',383); % Get the transition
    >> t.view  % view the transition
    

    For more info see the API Documentation.