Main Content

Log Signals in MAT-Files on an Android Device

You can use MAT-file logging to save signals from Simulink® models on an Android® device. The signals from these models are saved as data points in MAT-files. With the data you log, you can apply fault analysis, search for transient behavior, or analyze sensor data collected over a long period of time. The data points can be saved in: Structure, Structure with time, or Array format. Simulink supports logging signals on the Android device from only these two blocks:

Without MAT-file logging on the Android device, you can only log and analyze signals on the device through External mode or by sending the signal to a computer (using UDP or TCP) and storing it in MATLAB®. These mechanisms need an active connection between the computer and the device when logging data. With MAT-file logging, you can log signals without any need to connect the device to a computer. Other advantages of logging signals to MAT-files over other mechanisms are:

  • The ability to collect signals over a long duration for analysis.

  • The ability to store the signals in a well-structured MAT-file, including timestamp information.

Before you start to save signals from Simulink models on the Android device, complete the steps listed in Prerequisites for Logging Signals.

  1. Configure Board Parameters and Enable MAT-File Logging: To save MAT-files on the Android device, the MAT-file logging option in the Configuration Parameters dialog box must be selected. Also, the device parameters must be specified.

  2. Configure Model to Log Signals on the Android Device: MAT-file logging is supported in models containing To Workspace or Outport blocks. Specify the values for several block parameters.

  3. Run Model on the Android Device: Simulink deploys code and logs signals on the Android device as MAT-files.

  4. Import MAT-Files into MATLAB: After logging is complete, you can open MAT-files in MATLAB and use them for further analysis.

Related Topics