Return logged angular velocity data from iOS sensor
This example assumes that you have already installed and set up MATLAB® Mobile™ on your iOS device and connected it to your computer running MATLAB. If you have not, see Install MATLAB Mobile on Your Apple iOS Device (MATLAB Mobile for iOS).
Start MATLAB Mobile on your iOS device.
On the Sensors screen, tap the Angular Velocity sensor.
Place the device where you want to get the sensor data.
On your computer, create a
m, in MATLAB.
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.
Get the logged angular velocity data.
[av, t] = angvellog(m)
This returns the angular velocity log, where
contains the three data points in
Z rotations, in
radians per second.
See Device Orientation (MATLAB Mobile for iOS) for a diagram showing the
Z axes relative to
log— Name of variable for angular velocity log data
Name of variable for angular velocity log data, returned as an
[mx3] matrix of data points from the Angular Velocity sensor on the
iOS device. The three data points are the angular velocity reading
Z rotations, in radians per second.
Angular velocity is defined in relation to the
Z axes and in standard right-hand rotational
vector notation. If you place the device face-up on a table, the
positive X-axis extends out of the right side of the device,
positive Y-axis extends out of the top side, and the positive Z-axis
extends out of the front face of the device. This is independent of
the orientation of the device.
timestamp— Name of variable for timestamp
Name of variable for timestamp, returned as an [mx1] vector of
timestamps from the Angular Velocity sensor on the iOS device. Time
is in seconds, relative to the