poslog

Return logged position data from iOS sensor

Syntax

[lat, lon, timestamp, speed, course, alt, horizacc] = poslog(m)

Description

example

[lat, lon, timestamp, speed, course, alt, horizacc] = poslog(m) returns the logged position data for one or more of these variables, where m is the name of the mobiledev object that acquires the sensor data, and the other variables represent latitude, longitude, timestamps, speed, course, altitude, and horizontal accuracy. Position data is obtained from GPS, Wi-Fi, or the cellular network, using whichever is available.

Examples

collapse all

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. For information about these steps, see Get Started with iOS Sensors (MATLAB Mobile for iOS).

Start MATLAB Mobile on your iOS device.

On the Sensors screen, tap the Position sensor.

Place the device where you want to get the sensor data.

On your computer, create a mobiledev object, m, in MATLAB.

m = mobiledev

Begin logging data by enabling the Logging property.

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 position data for latitude, longitude, timestamps, speed, course, altitude, and horizontal accuracy.

[lat, lon, t, speed, course, alt, horizacc] = poslog(m)

Note

Position data may not appear immediately, due to the way it is collected. You may see a lag in the data.

See Device Orientation (MATLAB Mobile for iOS) for a diagram showing the X, Y, and Z axes relative to the device.

Output Arguments

collapse all

Name of variable for latitude log data, returned as an [mx1] vector of latitude values in degrees relative to the equator, with positive values indicating latitudes north of the equator.

Name of variable for longitude log data, returned as an [mx1] vector of longitude values in degrees relative to the zero meridian, with positive values extending east of the meridian.

Name of variable for timestamp, returned as an [mx1] vector of timestamps from the Position sensor on the iOS device. Time is in seconds, relative to the InitialTimestamp property.

Name of variable for speed log data, returned as an [mx1] vector of speed values in meters per second.

Name of variable for course log data returned as an [mx1] vector of course values in degrees relative to true north.

Name of variable for altitude log data, returned as an [mx1] vector of altitude values in meters above sea level.

Name of variable for horizontal accuracy log data, returned as an [mx1] vector of radial horizontal accuracy values in meters defined by a circle around the latitude and longitude.

Introduced in R2015a