Skip to Main Content Skip to Search
Product Documentation

outputData - Create, retrieve, or delete data output to Simulink base workspace of state activity status

Syntax

StateData = thisState.outputData(action)

Description

The outputData method of this state creates, retrieves, or deletes a special data object of type State. This data is attached internally to an output port on this state's Stateflow block in a Simulink model to output the activity status of this state to the Simulink base workspace during run-time.

Arguments

thisState

The state object for which to add a special port.

action

This string value can be one of the following:

  • 'create' — Returns a new data object of type State and attaches it internally to a new state activity output port on this state's Stateflow block.

  • 'get' — Returns this state's existing data object of type State attached internally to an existing state activity output port on this state's Stateflow block.

  • 'delete' — Deletes this state's data object of type State and the state activity output port on its Stateflow block to which it is attached.

Returns

StateData

The data object of type State for this state

Examples

If state A is represented by State object sA, the following command creates a new data object of type State, which is output to the Simulink base workspace and contains state A's activity:

s.outputData('create')

The Chart block in the Simulink model that contains state A now has an output port labeled A, the name of state A. In the Model Explorer, state A now contains a data object of type State whose scope is Output to Simulink.

The following command returns a Data object, d, for the data output to the Simulink base workspace containing state A's activity:

s.outputData('get')

The following command deletes the data output to the Simulink base workspace containing state A's activity:

s.outputData('delete')
  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS