Communicating APM with MATLAB

Dear all,

I would like to communicate my APM2 with MATLAB using USB.

Basically, I would like to send the raw data of the accelerometer, gyros, and the magnetometer to MATLAB for advanced processing.

What is the right code to write on the APM as well as on MATLAB for the communication to work as perfect as possible with the minimal packets loss, if none at all ?!

I really need your help to get this done as soon as possible!


EDIT:  Oct 31st, 2015

SOLUTION is here,

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • Hi everyone !!

    It's been ages since I worked with APM. Currently I use Pixhawk/PX4 in my research work, and I use PX4 Firmware, not Ardupilot firmware. I have just finished writing and testing a Matlab interface called MatMav 1.0 that allows one to monitor/command Pixhawk/PX4 loaded with PX4 Firmware. I will share a test version, not the full one, on my MATLAB, profile in FileExchange. I will pos the link here too, once uploaded.

    Here are some videos during the development stage of MatMav 1.0






    PX4 Autopilot Software. Contribute to PX4/Firmware development by creating an account on GitHub.
  • Hi, can I also have the code osbihat@hotma

  • Hi all,

    I am doing some polish to the code and then I will post it on Mathworks File exchange. I will put a link here.

  • I would like to take a look as well, could I?

  • Can i have some code?

  • Can you please send me the code on

  • Hi Zahana, I am working on a similar project which involves accessing the IMU data in real-time and processing it in Matlab. I am very interested in how you have done it. Do you mind send me your work to my email? My email is Thank you very much.

  • Can you please send me the code on

  • Dear Mohammad Zahana

    I am also looking for the ways to communicate with matlab with my APM 2,6

    I want you to help me if is possible

    my email adress is

  • Can i have the code? Email Address:

    Thank You,

This reply was deleted.


Hiroki Tanaka liked Hiroki Tanaka's profile
Oct 13
Derrick Davies liked lisa TDrones's profile
Sep 23
xemone liked Max Gilson's profile
Aug 31