Apple iOS Sensors Data Acquisition

Acquire data from Apple iOS sensors


The MATLAB® Support Package for Apple iOS Sensors and support for MATLAB Mobile™ access from a computer will be removed in a future release. Use mobiledev and other support package functionality in the MATLAB Mobile app by connecting to the MathWorks® Cloud instead.

Acquiring sensor data streaming involves creating a mobiledev object, turning on the sensors, and logging data to MATLAB. You can then process the logged data, including creating plots. For an example of acquiring data and plotting it, see Use Logged Sensor Data.

You can also acquire sensor data locally on the iOS device, with or without a network connection. This is an alternative method of collecting the sensor data instead of streaming it from the device to your computer running MATLAB. This is especially useful if you want to collect sensor data while your device does not have a network connection. For examples of using this method of acquisition, see Acquire Sensor Data Locally on Mobile Device.


mobiledevCreate mobiledev object to acquire data from iOS sensors
dispDisplay properties of mobiledev object
accellogReturn logged acceleration data from iOS sensor
angvellogReturn logged angular velocity data from iOS sensor
magfieldlogReturn logged magnetic field data from iOS sensor
orientlogReturn logged orientation data from iOS sensor
poslogReturn logged position data from iOS sensor
discardlogsDiscard all logged data from iOS sensors
readMobileSensorDataImport sensor data from file collected by MATLAB Mobile


Acquire Sensor Data Streaming

You communicate with the iOS device by creating a mobiledev object. You can then control the sensors and acquire data from them.

Use Properties to Control iOS Sensor Acquisition

You can use properties to display current sensor values, enable and disable sensors from MATLAB, turn logging on and off, set sample rate, and show connection and logging status.

Use Logged Sensor Data

You can use the logged sensor data either during or after acquisition for plotting and other analyses. This example shows how to plot orientation data.

Acquire Sensor Data Locally on Mobile Device

You can acquire sensor data locally on the iOS device, with or without a network connection.

Featured Examples