I want to read the initial value of an output signal in a Stateflow and store it in a variable. I am able to access the object of Data of a Stateflow in the following manner:
SF: is the path of the Stateflow
tmp_SFObj = get_param(SF,'Object')
tmp_ChartObj = tmp_SFObj{1}.find('-isa','Stateflow.Chart')
tmp_SFData = tmp_ChartObj.find('-isa','Stateflow.Data')
But problem arising is that the object 'tmp_SFData' does not have 'Initial Value' as its dataobject variable. How can i get Initial Value of the Output in a variable ??
I am getting following object parameters for an Output signal (No option for Initial Value):
K>> tmp_SFData(1)
ans =
Path: 'xyz'
Id: 690
Machine: [1x1 Stateflow.Machine]
SSIdNumber: 117
Name: 'abc'
Description: ''
SaveToWorkspace: 0
TestPoint: 0
OutputState: []
DataType: 'uint8'
Props: [1x1 Stateflow.DataProps]
ParsedInfo: [1x1 Stateflow.DataParsedInfo]
CompiledSize: ''
CompiledType: 'unknown'
Debug: [1x1 Stateflow.DataDebug]
Tag: []
Document: ''
Scope: 'Output'
Port: 1
InitializeMethod: 'Expression'
UpdateMethod: 'Discrete'
MessageMode: 'NotMessage'
LoggingInfo: [1x1 Stateflow.SigLoggingInfo]