The MATLAB® Support Package for Apple iOS Sensors enables you to collect sensor data from your iOS device and log it in MATLAB. You can use MATLAB to process the sensor data in a variety of ways, including creating plots. You can collect data from these sensors:
Use of iOS sensors requires:
Installation of MATLAB Mobile™ on your iOS device. You can acquire this application through the App Store.
Installation of the MATLAB Support Package for Apple iOS Sensors on your computer, or a MathWorks Cloud account. The support package is already installed in the MathWorks Cloud.
MATLAB R2015a or later, for creating the connection to the application and logging sensor data.
iOS 8 or later on your device.
The support package includes the command-line interface in MATLAB and
the ability to interact with iOS sensors via a screen in MATLAB
To connect to sensors on the device and collect data, you create
mobiledev object in MATLAB. You make the connection
between your computer running MATLAB and the device via Wi-Fi® or
your cellular network, or use MATLAB on the MathWorks Cloud.
Please note that MATLAB Mobile and MATLAB Connector™ are intended for use behind a firewall on a private network. If you plan to use MATLAB Mobile and MATLAB Connector over the public Internet, via 3G, or via 4G, it is recommended you use a virtual private network (VPN).
Install the support package in MATLAB if you will be running the MATLAB session on a computer.
Install MATLAB Mobile on your iOS device.
Using MATLAB Connector, connect your iOS device to the computer running MATLAB, via Wi-Fi or your cellular network. Alternatively, you can use the MathWorks Cloud. For details, see Set Up and Connect to Apple iOS Device.
Review the sensor settings in MATLAB Mobile. On the Settings screen, tap the Settings icon, and scroll to the Sensors section.
Control from MATLAB — When enabled, controls the sensors and logging of data from MATLAB. This setting is enabled by default.
Send Position Data in Background — When enabled, allows the position sensor to continue sending data to MATLAB while you are using other apps. This setting is disabled by default. The other sensors cannot send data in the background.
Getting Started with Sensors — Instructions on setting up sensor data collection.
In MATLAB, create a
to access the sensor data.
m = mobiledev
For more details, see Acquire Sensor Data Streaming.
You can control the sensors, log the sensor data, query latest values, and plot the data or do other post-processing tasks. For details on these actions, see Acquire Sensor Data Streaming, Use Properties to Control iOS Sensor Acquisition, and Use Logged Sensor Data.