Go Down

Topic: Octave/Matlab Vector Programming in Due (Read 10 times) previous topic - next topic


Jan 19, 2013, 11:05 am Last Edit: Jan 28, 2013, 04:28 am by randomvibe Reason: 1
I'm very interested in programming complicated matrix operations in Arduino Due, but with the simplicity offered in Octave and Matlab.  For example, the Kalman gain matrix (one of many implementations) is:

K = Pp * H' * inv(H * Pp * H' + R);

Implementing the equation above in standard C would be very complicated, very messy, and difficult to read. In Matlab or Octave, the code is literally the above equation. I literally copied it from one my programs. This syntax is known as vector programming - it's a huge time saver.  Various libraries exist (links below) that allow such syntax in C.  Is it possible to include such a library for the Due?  Has anyone done this?  Thank you.  The answer is yes with the Eigen C++ library ( http://eigen.tuxfamily.org ).

Detailed instructions for Arduino-Due here:


does this help a bit - http://playground.arduino.cc/Code/MatrixMath -?
probably not tested on DUE yet?
And needs rework to overload the * operators etc. but it might be a start

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Jan 20, 2013, 08:19 am Last Edit: Jan 21, 2013, 10:49 am by randomvibe Reason: 1
There's no reason why the MatrixMath library should not work.  It does need plenty of rework to overload the +, -, *, /, ~ operator for binary matrix math.

I'd rather use the following libraries because they are proven and my C programming skills are weak.  I'd be nice if someone has done this already for the benefit of the community.




Don't put too much hope in those two library especially Eigen. They are big packages not written for micro-controller.

I don't know much of the other but Eigen in is a very big library with complex inside dependency and even if you use only a very small subset of its functionality it will be very difficult to remove enough things to make it fit in the Due memory.
Better to look for math library specialized for micro controller where algorithm are chosen for their size.



One or two people have experimented with Python on Arduinos, possibly easier now we have the Due.  Might be worth looking at if someone could get it going with the 'numpy' library (now a serious contender to Matlab).


Go Up