MATLAB: How to get Data type of stateflow input through script

guiMATLABscriptsimulink

How to get Data type of stateflow input through script?

Best Answer

To get the data type defined in the Model Explorer:
tmp_SfPath = gcb;
get_param(tmp_SfPath,'Object')
tmp_SFObj = get_param(tmp_SfPath,'Object')
tmp_ChartObj = tmp_SFObj.find('-isa','Stateflow.Chart')
tmp_SFData = tmp_ChartObj.find('-isa','Stateflow.Data')
if(strcmp(tmp_SFData(1).Scope,'Input'))
tmp_SFData(1).DataType
end