In Stateflow, you have the ability to define a structure as "parameter data" and access its individual fields using dot notation.
For example, consider the following MATLAB code where we define a structure named "structA" with fields "f1", "f2", and "f3”
structA = struct('f1', 6, 'f2', 22, 'f3', 100);
Now,to use "structA" within your Stateflow chart, follow these steps:
- Open the symbols pane in Stateflow.
- Click “Create data”
- Set the data type to "Parameter data."
- Name the new data symbol "structA".
I have attached an example model for your reference.