sending data from mobile sensor to simulink continuously

Hi I need to send data continuously from matlab workspace to simulink, I am reading a mobile sensor and need the readings to be instantly sent to simulink , so the readings are the inputs to simulate a hardware model connected with matlab through arduino.

 Accepted Answer

You will always have a latency and maximum throughput in receiving signals and making them available to Simulink.
I am not clear as to why you are not using the Simulink Android sensor blocks ?

6 Comments

thank you so much for answering, I have trouble in downloading the simulink support package to android, and I need the orientation sensor measurement which I don't think there is a block for it in the toolbox.
to be clear about what I am asking for, https://www.youtube.com/watch?v=bfbWrSec16k&list=LL2D_8DMrBhYJWhy2RqtPV8A&index=11 I have followed this video procedure but instead of using flight gear I am simulating my own model and I did it successfully, but when I am replacing my model with a hardware model which is connected to matlab by arduino using external mode, an error appeared from the evalin command saying that evalin function are not suitable with code generation!
so I have replaced the function block with three constants and I need a way to keep these constant values changing continuously ! I have tried set_param but it is too slow.
Would the gyroscope block be acceptable for orientation?
Are you able to install the support package on your PC? But then you have trouble getting the support package to communicate with the Android? Have you turned on USB debugging on the android? https://www.mathworks.com/examples/simulink/mw/android_product-androidusageexample-working-with-android-8482-devices-block-library#4
Hi I have installed the support package and turned on the USB debugging but the matlab is not detecting my device( samsung galaxy s6 edge)! any suggestion please? the hardware pane only shows the s4 and tab 2 options thanks
Which MATLAB release are you using? The hardware support package only supported the S4 and Tab 2 in the original release, but it was enhanced to all Galaxy and Nexus devices a couple of releases ago.
I am using matlab 2015b release
Ah, the upgrade to support all Galaxy was in R2016a; https://www.mathworks.com/help/supportpkg/android/release-notes.html
You could try installing from the "Get Support Package" link at https://www.mathworks.com/hardware-support/android-programming-simulink.html to see if you get the newer version.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!