Discard all logged data from mobile device sensors
To use this function for accessing mobile device sensors remotely from MATLAB® installed on a desktop or laptop computer, you must also install either MATLAB Support Package for Apple iOS Sensors or MATLAB Support Package for Android® Sensors. For more information, see Get and Manage Add-Ons.
discardlogs(m) discards all logged data, from
mobiledev object that acquires the
sensor data. The
discardlogs function discards all logged
measurements that were created from the object, and also clears the initial
Discard Logged Data
This example assumes that you have already installed and set up MATLAB Mobile™ on your device. If you have not, see Install MATLAB Mobile on Your Device.
If you want to access the data in a different session of MATLAB, start MATLAB Online™ or MATLAB on your local computer.
Start MATLAB Mobile on your mobile device.
On the Sensors screen, tap the sensors that you want to send data from.
Place the device where you want to get the sensor data.
In your MATLAB session, create a
m = mobiledev
Begin logging data by enabling the
m.Logging = 1
This action starts the transmitting of data from all selected sensors. You can also start transmission by tapping the Start button in MATLAB Mobile on the device.
Get any logged data you are interested in viewing, for example, the angular velocity data.
[av, t] = angvellog(m);
Stop logging data from the selected sensors by disabling the
m.Logging = 0
This stops the transmitting of data from all selected sensors. You can also stop transmission by tapping the Stop button in MATLAB Mobile.
You can still access any of the logs after you stop transmitting data. When you are done using the logs, you can discard them.
This discards all logged measurements and also the initial timestamp.
Introduced in R2015a