Code covered by the MathWorks Limited License

Highlights from
Android Sensor support from MATLAB


3.3 | 15 ratings Rate this file 231 Downloads (last 30 days) File Size: 1.04 MB File ID: #40876
image thumbnail

Android Sensor support from MATLAB



31 Jul 2013 (Updated )

Use MATLAB to acquire sensor data from built-in sensors on your Android device.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

This submission enables MATLAB to access onboard sensors on Android mobile devices. With this submission, you can access a mobile device’s accelerometer, magnetometer, location, orientation and compass information directly from MATLAB running on your computer. You can access current and logged sensor data, and you can use MATLAB to visualize and analyze the mobile sensor data or make decisions based on the acquired data.

To use this submission, the computer and mobile device must be on the same network. The submission includes the necessary MATLAB files and a read me document for initial setup.
In order to use this support, you must first install the “Sensor UDP” mobile app available from Google Play.

For more information about MATLAB Android sensor support:

To access iPhone or iPad sensors from MATLAB:

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (30)
09 Jun 2014 Luis Cuya Caycho

Muy buena!

25 May 2014 AAA ESV

muchas gracias, muy buena programación...

22 Mar 2014 Jin


thanks for your code. I have a problem:
"No data received."

My host computer is also connected to network through WiFi, is there problem for the mobile phone to transmit the data?

08 Mar 2014 Greg

No GPS transmitted from Galaxy S II. All other sensors rcv good. GPS enabled under Location Services. Any ideas on what's preventing GPS transmission?

09 Feb 2014 Suraj Kamya

Working awesome.

05 Feb 2014 Rajiv  
26 Jan 2014 Hasan

I get these problems when I try to install it on R2013b on Wnd7 64bit. I added the folder and subfolders to the path.

Warning: Installation failed.
Error using matlab.apputil.install (line 38)
The specified file 'Mobile Sensor Explorer.mlappinstall' could not be found.

Error in setupmobile (line 37)
matlab.apputil.install('Mobile Sensor Explorer.mlappinstall');

25 Jan 2014 Martin

Works perfectly. examples have some issues, but the main functions are good. Exactly what I needed.

13 Jan 2014 MathWorks Mobile Sensor Connectivity Team

As stated in the header of The GPS example file, Mapping Toolbox (which includes geopquadpt) is required for that example to be fully functional. The other examples included in the submission do not require Mapping Toolbox.

13 Jan 2014 Juyeong

I tried to follow the example(Capturing and Mapping GPS Example) and failed to run the line

[latlim, lonlim] = geoquadpt(lat, lon);

with error message
"Undefined function 'geoquadpt' for input arguments of type 'double'."

am I missing the function 'geoquadpt' in my path? or other problems?

08 Jan 2014 MathWorks Mobile Sensor Connectivity Team

This submission will only work on R2013a and R2013b.

08 Jan 2014 Prashnna Gyawali

Isn't there any possibility of using this submission on the older version of MATLAB like R2011a??

05 Jan 2014 Emad

Same problem as "danushka bandara": when I run setupmobile on 64 bit Matlab 2013a
The specified file 'Mobile Sensor Explorer.mlappinstall' could not be

31 Dec 2013 qian yong  
17 Dec 2013 José Ramón Menzinger  
18 Nov 2013 jomi karacha

Thanks !

15 Nov 2013 danushka bandara

I get this error when I run setupmobile on 64 bit Matlab 2013a
The specified file 'Mobile Sensor Explorer.mlappinstall' could not be

23 Sep 2013 Teemu Pulkkinen

Any chance you could add an option for turning off logging? I have no need for it (I do it myself when I need to), and I dislike having to periodically empty it because it's growing so large.

11 Sep 2013 Paul

Works in France on Android HTC One X device after setting language to English. No Position/Altitude, though. Please provide a Simulink block! thanks.

05 Sep 2013 Dennis Nielsen  
29 Aug 2013 MathWorks Mobile Sensor Connectivity Team

We have identified a bug when using Android devices configured with European settings. In this scenario, MATLAB will not receive data, and the connection will time out. We are working on a fix, but as a workaround, set your device to “US English” while using the SensorUDP app.

27 Aug 2013 MathWorks Mobile Sensor Connectivity Team

The most recent update on 8/26 includes a minor change to one of the examples (azimuth, pitch, roll) included in the submission. It was changed to make the sample code more readable. If you already were using the prior version, it is not necessary to download this update.

15 Aug 2013 Misha

This submission will work ONLY on 13a.

15 Aug 2013 hammad

would this submission run only on 2013a version or may be compatible with older versions also?

09 Aug 2013 Mark Jones

Hi Marc, David, and Chethan,

Can you tell us the full path to where you have unzipped the package to? For example, where does mobilesensormlconverter.dll curently reside?

Also, just to be sure, you did run setupmobile.m first, correct?

Please let us know at:

Let's see if we can't figure out what is going on here and improve your experience!


09 Aug 2013 Chethan C U

Yup... same error here..

08 Aug 2013 DAVID Torres  
08 Aug 2013 DAVID Torres

Same problem as Marc:
Failure to load the requested plugin:

I can't add the private folder to the path.

06 Aug 2013 Marc

I've followed the instructions and received the following error:
Warning: The following error was caught while executing
'matlab.mobilesensor.internal.MobileSensorController' class destructor:
Attempt to reference field of non-structure array.
> In sensorgroup>sensorgroup.sensorgroup at 395
Failure to load the requested plugin: C:\...\private\win64\mobilesensormlconverter.dll

But the file does exist and I am in the correct directory. Any advice?

31 Jul 2013

Updated File

05 Aug 2013

Updated file.

20 Aug 2013

Updated File and readme.

26 Aug 2013

Updated file.

16 Sep 2013

Fixed problem with receiving data on Android phones with European settings. Enhanced install file(setupmobile.m) now checks for supported MATLAB versions. Minor documentation updates.

Contact us