How to connect a PC with Matlab to an Android device over USB?

3 ビュー (過去 30 日間)
Jose Valenzuela Ruiz
Jose Valenzuela Ruiz 2021 年 5 月 11 日
I have Matlab installed on a laboratory control PC. On that computer I am going to program a script that carries out certain tasks, and one of them is to send some orders to an Android device. That device has to send information from its sensors when it receives the order.
If I could use Android Mobile it would be perfect because there I have everything I need, but I cannot connect any of the devices to the internet. My only solution is to communicate both devices via USB, but I can't figure out which protocol/functions I have to use (and I cannot use Simulink as I am using Psychtoolbox to program the experiment).
Do you know how to communicate and send/receive data over USB?
Thank you!

採用された回答

Sutanu Maiti
Sutanu Maiti 2021 年 5 月 12 日
If you have Simulink, then you can use "Simulink Support package for Android Devices" which allows you to transfer sensor data to Simulink model during normal mode simulation:
Or, during external mode simulation:
Or, even you can deploy a Simulink model as a stand alone app that uses TCP / UDP blocks to send data back to MATLAB / Simulink:
  1 件のコメント
Jose Valenzuela Ruiz
Jose Valenzuela Ruiz 2021 年 5 月 13 日
Hi Sutanu,
Thanks for your quick answer. I knew about this support package and I've already tested it but as I say, using Psychtoolbox I cannot work with Simulink. But I will check your links to see if I can find a way to extract the functions Simulink is using and play with a script using them.
Thanks a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAndroid Devices についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by