MATLAB Answers

Arduino support from MATLAB and Simulink across releases

What are all the different ways I can use Arduino with MathWorks products? Which of these approaches is possible on the release I’m using? Which are officially supported by MathWorks?  How can I decide which one I should be using?

5 Answers

Answer by MathWorks Support Team on 14 Sep 2015
 Accepted Answer

Arduino hardware can be connected to MATLAB and Simulink in numerous ways. This article describes the differences between the most popular ways of using Arduino hardware with MathWorks software. The latest support is described at www.mathworks.com/arduino.

Whenever possible, it is recommended to use the MATLAB Support Package for Arduino Hardware or the Simulink Support Package for Arduino Hardware. These solutions are authored by MathWorks development and will be maintained and enhanced over time. If you require any features that are not provided in these offerings, please submit a request here to help prioritize future enhancements.

1. MATLAB Support Package for Arduino Hardware

Directly stream real world inputs and outputs between an Arduino and a computer running MATLAB. Contains only MATLAB functions, not Simulink blocks.  All computations occur in MATLAB on a desktop computer, which is connected to the Arduino over serial. Does not support the ability to program the Arduino for standalone execution. Authored by MathWorks development and will be enhanced over time.

Release Compatibility: R2014a and later

Web Page: http://www.mathworks.com/hardware-support/arduino-matlab.html

Documentation: http://www.mathworks.com/help/supportpkg/arduinoio/

2. Simulink Support Package for Arduino Hardware

Embed algorithms developed in Simulink onto an Arduino device for standalone execution. Simulink models run locally on the device. On some devices, data can be sent back to Simulink when running in External mode. MATLAB code can be included by using a MATLAB Function Block. Authored by MathWorks development and will be enhanced over time.

Release Compatibility: R2012a and later

Web Page: http://www.mathworks.com/hardware-support/arduino-simulink.html

Documentation: http://www.mathworks.com/help/supportpkg/arduino/

3. Legacy MATLAB and Simulink Support for Arduino Hardware

Directly stream real world inputs and outputs between an Arduino and a computer running MATLAB and Simulink. Includes both MATLAB functions and Simulink blocks. Interactive communication with a Simulink model running in Normal mode. Provides support for encoders. Does not support programming board for standalone execution. Not maintained or tested by MathWorks.

Release Compatibility: R2011a and later

Web Page: http://www.mathworks.com/matlabcentral/fileexchange/32374

Examples: http://www.mathworks.com/matlabcentral/fileexchange/27843

4. Embedded Coder Target for Arduino

Custom Embedded Coder target that uses Arduino as the platform. Requires Simulink and Embedded Coder. Provides access to more code generation optimization options and access to the auto-generated code that is used to program the board. Supports Processor-in-the-Loop (PIL) mode. Custom Target can be modified for other microprocessors. Not maintained or tested by MathWorks.

Release Compatibility: R2013b and later

Web Page: http://www.mathworks.com/matlabcentral/fileexchange/30277

  1 Comment

On some devices, data can be sent back to Simulink when running in External mode. extra helpful..

Log in to comment.


Answer by Pradeep KS on 20 Jun 2016

MATLAB Support Package for Arduino Hardware and Simulink Support Package for Arduino Hardware supports boards from Arduino.cc.

Arduino.org boards are not currently supported by MATLAB and Simulink Arduino Support Packages.

  0 Comments

Log in to comment.


Answer by cmsr
on 4 Jul 2016
Edited by cmsr
on 4 Jul 2016

Hello,

I not see WiFi shield support for MATLAB, like yun shield, here is compatibility or not for an Arduino Mega board with a yun shield. Note that it is not Arduino Yun is a Arduino Mega with a wifi shield.

Thanks

  1 Comment

Here is a list of supported arduino hardware for MATLAB :

https://www.mathworks.com/hardware-support/arduino-matlab.html

You can also contact MathWorks Technical Support team if you have any further questions regarding the same.

Log in to comment.


Answer by LOKENDRA SINGH on 11 Sep 2016

Please provide offline zip files for arduino hardware support for matlab and simulink . As the zip downloaded from option get hardware support through internet option and download option error -- invaild zip or corrupt file message appears in matlab 2015b

  1 Comment

Hello Lokendra, I suggest you to contact MathWorks Technical Support if you still have this issue.

Log in to comment.


Answer by Omar Crypps on 29 Jan 2017

I had a problem when installing the Arduino support package the error says

Error installing third party software adafruit motor shield v2 Library

Do you have any idea how i can solve this problem ?

  1 Comment

Hi Omar,

If you are still facing installation issues, please contact MathWorks Technical Support.

Log in to comment.


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!