Stateflow User's Guide Previous page   Next Page

Access the Chart Object

In the previous section, Access the Model Object, you accessed the Model object containing your new chart to return a handle to the Model object for your new model, m. Perform the following steps to access the new Stateflow chart:

  1. Access the new Chart object and assign it to the workspace variable chart as follows:
  1. In the preceding command, the find method of the Model object m returns an array of all charts belonging to that model. Because you created only one chart, the result of this command is the chart you created. If you created several charts, the find method returns an array of charts that you could access through indexing (for example, chart(1), chart(2), and so on).

    You can also use standard function notation instead of dot notation for the preceding command. In this case, the first argument is the Model object handle, m.

  1. Open the Stateflow chart with the following API command:
  1. The preceding command calls the view method of the Chart object whose handle is chart. This displays the specified chart in the Stateflow diagram editor. You should now have an empty Stateflow chart in front of you. Other Stateflow API objects have view methods as well.


Previous page  Access the Model Object Create New Objects in the Chart Next page

© 1994-2005 The MathWorks, Inc.