Android app and Matlab socket communication
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to send the accelerometer data from my android phone to matlab to plot graph. I know about matlab app but i want to create my own app which does the same.Can anyone provide the code required for accepting the data into matlab.
0 comentarios
Respuestas (1)
Cam Salzberger
el 4 de Ag. de 2017
Hello Sumit,
Though I don't have code for you, here is an idea for how you could go about doing this. The problem primarily seems to be in two parts: (1) Reading and sending the data from MATLAB, and (2) Receiving and displaying the data on your computer.
1) You have a few options here, so I'll just mention a couple:
a) If you have Simulink and Embedded Coder, you can use the Simulink Support Package for Android to create your own apps from Simulink models. You can use the Accelerometer block to read the data from your sensors, and the UDP Send block to broadcast the data over the network. You could even put a scope or six into the model, and view the data directly on your phone.
You'll need your phone to be on the same WiFi network as your computer for the UDP communication to work though.
b) There are various apps on the Play Store that you can get to broadcast your sensor data over a network. Here is one example. No need to make your own app.
2) There are also a couple of ways to get the data into MATLAB, depending on what products you have:
Once you have the data in, you can display it however you like. Hope this helps!
-Cam
0 comentarios
Ver también
Categorías
Más información sobre Scopes and Data Logging en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!