Filter löschen
Filter löschen

How to get Data type of stateflow input through script?

5 Ansichten (letzte 30 Tage)
How to get Data type of stateflow input through script?
  1 Kommentar
The Matlab Spot
The Matlab Spot am 13 Dez. 2013
Do you want the data type to be compile time or defined in the data explorer?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

The Matlab Spot
The Matlab Spot am 13 Dez. 2013
Bearbeitet: The Matlab Spot am 13 Dez. 2013
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
  2 Kommentare
The Matlab Spot
The Matlab Spot am 13 Dez. 2013
Similarly you can check the SCOPE for other type of data also.
vinothkannan K
vinothkannan K am 16 Dez. 2013
Bearbeitet: vinothkannan K am 16 Dez. 2013
Thanks Spot.,

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

The Matlab Spot
The Matlab Spot am 13 Dez. 2013
To get the data type of the input of the stateflow at compile time (for data set as inherit from Simulink)
1. Compile the model using
[sys,x0,str,ts] = model_name([],[],[],'compile');
2. Get the Statflow block input port's compiled port data type

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by