MATLAB: Is the PARROT Minidrone not logging data in MATLAB R2017a

Aerospace Blocksetminidronesparrot

I am using MATLAB R2017a and I tried to run the 'asbQuadcopterStart' command in MATLAB. The code gets compiled successfully. I am able to start the drone, have it lift up and go back to the ground.
However, after I run the 'p.getMATfile' command, MATLAB prints a statement saying "Downloading RSdata.mat from minidrone…" After a few seconds, a window pops up with the following error message:
No MAT-File found inside mini drone. Check if MAT_File logging is enabled.
How do I enable MAT-File logging on the minidrone?

Best Answer

As a prerequisite, you need to have Simulink Coder to enable MAT-File logging on the Simulink model. To show the Simulink Coder parameters, please follow these steps:
  1. At the bottom of the Hardware Implementation pane click on the ellipses to open 'Advanced parameters'.
  2. Check the 'Use Simulink Coder features' option.
  3. Click 'Apply' to apply this change to the configuration parameters.
  4. Close and reopen the configuration parameters dialog box.
From this point you should be able to find the 'MAT-file logging' parameter in the 'Advanced parameters' section of the Code Generation > Interface pane. Alternatively, you can enter the following command in the MATLAB Command Window:
>> set_param('flightControlSystem', 'MatFileLogging', 'on')
Save the model and rebuild the code.