Can I upload Arduino Code written in MATLAB using MATLAB Arduino Support Package?
172 views (last 30 days)
Madhu Govindarajan on 25 Nov 2015
I don't think this is possible using MATLAB support package as the Simulink support package is the one that I most commonly use for standalone applications. However, you can use the code that you have written in MATLAB in a MATLAB function block in Simulink and download that code to an Arduino board for your application.
Walter Roberson on 25 Nov 2015
You might possibly be able to get the .m file copied to the arduino, but the arduino cannot run MATLAB code. The arduino runs compiled C or C++ code. When you use Simulink to build a model with an arduino target, Simulink generates C (or C++ ?) code and compiles it and sends it to the board.
To send compiled code to arduino without using Simulink, see http://www.mathworks.com/matlabcentral/answers/146590-send-new-program-to-arduino-without-simulink
Monday Ikhide on 27 Jan 2017
What about using the MATLAB compiler SDK for a MATLAB script file and then deploy this to the Arduino, this is the approach we are about to try. Has anyone else tried this?
Siamak Mohebbi on 30 Jan 2022
I had a similar question since Matlab IDE is a bit user friendly but not technology friendly.
The Arduino IDE uploads the sketches to their hardware no problem but folks at Matlab as usual decided that only Elite paying users (with Coder, Simulink, etc.) are allowed to do the same on their platform.
The work around perhaps would be, to use the DAQ toolbox to pass data to an already uploaded sketch through the Arduino IDE. Not sure if it is even possible since Matlab command will most likely wipeout the flash memory before executing on the Arduino board.