File Exchange

image thumbnail

Android Sensor support from MATLAB (R2013a, R2013b)

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

3.3913
25 Ratings

41 Downloads

Updated

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

For Android Sensor support in R2014a and higher releases see:
http://www.mathworks.com/matlabcentral/fileexchange/47618-matlab-support-package-for-android-sensors
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.
https://play.google.com/store/apps/details?id=jp.ac.ehime_u.cite.sasaki.SensorUdp&feature=nav_result

For more information about MATLAB Android sensor support:

www.mathworks.com/android-sensor

Comments and Ratings (49)

LZY

LZY (view profile)

matlab.apputil.install('Mobile Sensor Explorer.mlappinstall');
'Mobile Sensor Explorer.mlappinstall' cannot be found in the file.
What should I do?

wwchgc

wwchgc (view profile)

jingyu cong

I also get the message:
> In sensorgroup>sensorgroup.sensorgroup at 398
Failure to load the converter plug-in.
What should I do?

I also get the message:
"Warning: The following error was caught while executing
'matlab.mobilesensor.internal.MobileSensorController' class destructor:
Struct contents reference from a non-struct array object.
> In sensorgroup (line 398)
Failure to load the converter plug-in."

When I connect the iPhone 6 with MATLAB2015b.I get below error. "sorry there was an issue with MATLAB.you may need to repeat your last action."

please help me. does MATLAB201b valid for iPHONE6.?

hbh

hbh (view profile)

I get the following message when run“obj = sensorgroup('AndroidMobile');”

“Failure to load the converter plug-in.”
Who can solve the problem?Thank you!

I get the following message when run“obj = sensorgroup('AndroidMobile');”

“Failure to load the converter plug-in.”

Frank Chen

The same 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

Does it work let's say on

http://www.gsmarena.com/samsung_galaxy_note_3-5665.php

Because in the HW requirements it got only Galaxy S4

Great! Easy to install and work. Thank you.

Paul C

Paul C (view profile)

I get the following message when using Capturing and mapping with GPS example :

Error using bufgeoquad
Expected input number 3, BUFLAT, to be a scalar.

Error in bufgeoquad (line 28)
validateattributes(buflat, {'double'}, ...

Error in CapturingAndMappingGPSExample (line 67)
[latlim, lonlim] = bufgeoquad(latlim, lonlim, (max(lat) - min(lat)), ...

What should I do??

The mobile app needs work. Hate to have to enter all the settings every time I restart the app. Don't like the "send" option. It should just echo at a user defined interval.

The .m program worked once out of the 3 attempts.

Hi Deborah,

Which mobile phone and version of MATLAB are you using? Having this information might be helpful in figuring our the root cause of the erroneous behavior.

A couple of things to check:

1. Are the computer and mobile device on the same Wifi network?
2. Does the Mobile Sensor Explorer app show any data for any of the sensors?

Frank

Frank (view profile)

Neat. Works without any further ado.

Stefan

Stefan (view profile)

Works out of the box!

Mobile App not very handsome.

For those who have problems:

Check your home folder and firewall!

Can't get it to work at all. Tried the mobile setup first as instructed, and got the error messages as above. Finally managed to fix that, ran mobile setup successfully, but still can't get Matlab to see any data. Am getting error message: Error using CapturingAzimuthRollPitchExample (line 35)
No data received. Type "help sensorgroup" for help diagnosing the problem.
I have tried this on two separate wireless networks now (home and work). If I could get this to work it would be really awesome for my research and I would up my rating accordingly.

Muy buena!

AAA ESV

muchas gracias, muy buena programación...

Jin

Jin (view profile)

Hello!

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?

Greg

Greg (view profile)

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?

Suraj Kamya

Suraj Kamya (view profile)

Working awesome.

Rajiv

Rajiv (view profile)

Hasan

Hasan (view profile)

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');

Martin

Martin (view profile)

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

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.

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?

This submission will only work on R2013a and R2013b.

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

Emad

Emad (view profile)

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

qian yong

jomi karacha

Thanks !

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

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.

Paul

Paul (view profile)

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

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.

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.

Misha

Misha (view profile)

This submission will work ONLY on 13a.

hammad

hammad (view profile)

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

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:

http://www.mathworks.com/matlabcentral/fileexchange/authors/contact/331522

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

Thanks!
Mark

Chethan C U

Yup... same error here..
C:\......sensorgroup\sensorgroup\+matlab\+mobilesensor\+internal\..\..\..\private\win64\mobilesensormlconverter.dll.

DAVID Torres

DAVID Torres

Same problem as Marc:
Failure to load the requested plugin:
C:\......sensorgroup\sensorgroup\+matlab\+mobilesensor\+internal\..\..\..\private\win64\mobilesensormlconverter.dll.

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

Marc

Marc (view profile)

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?

Updates

1.7

Changed supported releases to 13a and 13b.

1.6

Added link to R2014b support.

1.5

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.

1.4

Updated file.

1.3

Updated File and readme.

1.2

Updated file.

1.1

Updated File

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video