You can use MATLAB to communicate with a Raspberry Pi board and its peripheral devices using MATLAB Support Package for Raspberry Pi.
You can program Raspberry Pi boards to run your algorithms using Simulink Support Package for Raspberry Pi Hardware. The support package generates code from your Simulink model in a click of a button that then runs on the Raspberry Pi board.
This tutorial covers a step-by-step guide to:
MATLAB Support Package
- Set up the MATLAB support package for Raspberry Pi
- Send commands from MATLAB to Raspberry Pi to blink the on-board LED
Simulink Support Package
- Set up the Simulink support package for Raspberry Pi
- Build a simple Simulink model for controlling pins on the Raspberry Pi
- Generate, download and run code on the Raspberry Pi to blink an LED
This is the first tutorial in a series on using MATLAB and Simulink to program a Raspberry Pi. In this tutorial Raspberry Pi 2 is used as an example, however the same steps can be used for other boards like Raspberry Pi Model B+ etc.