After you configure the Simulink model by including the necessary
Workspace blocks, you need to complete the prerequisites for simulation
px4PrepareModelForMATFileLogging function needs to be run
in the MATLAB command prompt to optimize the memory. The function checks the
Limit data points to last parameter in the various
To Workspace blocks and adjusts its value for memory
You can use the
px4PrepareModelForMATFileLogging function by
specifying the model name either as character or string:
modelname is the file name of the Simulink
After you run this function, a dialog box opens requesting your permission to fix the values for memory optimization. Click Fix it to optimize the memory.
After you click Fix it, the value for Limit data points to last corresponding to all 'To Workspace' blocks is changed.
It is recommended that you run the function
px4PrepareModelForMATFileLogging every time you make
changes in the model.
MAVLink needs to be enabled to retrieve the log files from SD card inserted on the
Pixhawk hardware board (for details about retrieving files, see
getMATFilesFromPixhawk). To enable
MAVLink, open the Configuration Parameters dialog box, go to Hardware Implementation > Target hardware resources > MAVLink, and select Enable MAVLink on /dev/ttyACM0.