MATLAB: Set Stateflow parameters from MATLAB command line

stateflow

In my Simulink model, how do I set Stateflow chart parameters such as SampleTime, Update Method, State Machine type etc. from the MATLAB command line or programmatically?

Best Answer

Set chart parameters such as SampleTime, Update Method, State Machine type etc.
Use the "set" command. Pick an API function from one of the following links:
and then follow the procedure below:
>> % Obtain the Stateflow chart's object
>> Stateflow.State(ch)
>> % Use the set command with the API function and its setting in pairs of char arrays:
>> ch.set('Name', 'Kentucky')
>> % You can set more than one API function at the same time:
>> ch.set('ChartUpdate','DISCRETE','SampleTime','0.1','StateMachineType','Mealy');