Sensors

To log sensor data locally on your device:

  1. In Sensors, tap Stream to and select Log.

  2. Select one or more sensors.

  3. Tap START.

  4. When you are done collecting data, tap STOP.

To automatically upload logs to your MATLAB Drive when your device has an internet connection, under Sensors > More, select Auto Upload. Alternatively, you can manually upload your logs.

To stream sensor data to MATLAB:

  1. Go to Sensors > More and turn on Sensor Access.

  2. In Sensors, tap Stream to and select MATLAB.

  3. Select one or more sensors.

  4. At the command line in MATLAB, create a mobiledev object:

      % First, get a list of available devices
      >> mobiledevlist
      % Then, create the mobiledev object with the desired device
      >> m = mobiledev('YOUR_DEVICE_NAME')

  5. Tap START.

  6. When you are done collecting data, tap STOP.

To acquire a camera snapshot in MATLAB:

  1. Go to Sensors > More and turn on Sensor Access.

  2. Then turn on Camera Access.

  3. At the MATLAB command, access the device camera and take a snapshot:

      % List available devices
      mobiledevlist
      % Connect to the device
      m = mobiledev('YOUR_DEVICE_NAME')
      % Access the camera
      c = camera(m)
      % Take a snapshot
      img = snapshot(c,'immediate’);

Note: Whichever method of sensor collection you choose, you cannot switch while data is being collected. Stop the current data collection, and then start with the new method.