- The sensor output of the stateflow can be written to a ".mat" file. To do this, a To File block can be added, which will store the data in ".mat" format. The datatype of output can be configured in the "Save format" field.
- The "MATLAB Function" (available at Simulink/User-Defined Functions) block can be used to capture and store sensor measurements for a specified period of time. In this block, the input is the sensor output data that needs to be written. You can write your code here in the function to store the data in the desired format for the specific period of time.
- To File: https://www.mathworks.com/help/simulink/slref/tofile.html
- MATLAB Function: https://www.mathworks.com/help/simulink/slref/matlabfunction.html