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 

  1. Set up the MATLAB support package for Raspberry Pi 
  2. Send commands from MATLAB to Raspberry Pi to blink the on-board LED

Simulink Support Package

  1. Set up the Simulink support package for Raspberry Pi
  2. Build a simple Simulink model for controlling pins on the Raspberry Pi
  3. 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. 

This guide was first published on Apr 16, 2015. It was last updated on Mar 08, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.