Main Content

MATLAB Support Package for Raspberry Pi Hardware

Program sensor and image applications on Raspberry Pi

MATLAB® Support Package for Raspberry Pi® Hardware enables you to communicate with a Raspberry Pi remotely from a computer running MATLAB or through a web browser with MATLAB Online™. You can acquire data from sensors and imaging devices connected to the Raspberry Pi and process them in MATLAB. You can also communicate with other hardware through the GPIO, serial, I2C, and SPI pins.

The support package functionality is extended if you have MATLAB Coder™ installed along with the MATLAB Support Package for Raspberry Pi Hardware. With MATLAB Coder, you can generate equivalent C code for the same MATLAB code used to interactively control the Raspberry Pi from your computer and deploy it directly to the Raspberry Pi to run as a standalone executable.

Installation and Setup

Install support for the hardware, update the firmware, and connect to the hardware

Connection to Raspberry Pi Hardware

Create a connection to Raspberry Pi hardware

Run on Target Hardware

Deploy a MATLAB function as a standalone executable on the hardware

Build Standalone Applications and Web Apps

Build standalone applications and Web Apps for Raspberry Pi hardware


Use the Raspberry Pi’s LED


Use the Raspberry Pi’s GPIO pins

Serial Port

Use the Raspberry Pi’s serial port

I2C Interface

Use the Raspberry Pi’s I2C interface

SPI Interface

Use the Raspberry Pi’s SPI interface

CAN Interface

Read and write CAN messages to CAN shields on Raspberry Pi hardware

Camera Board

Use the Raspberry Pi's add-on Camera Board

Sense HAT

Use the Raspberry Pi’s add-on Sense HAT Board

Web Camera

Use the Raspberry Pi web camera

Multi Camera Adapter

Use Raspberry Pi with Multi Camera Adapter Module

Pulse Width Modulation

Use Raspberry Pi to create pulse-width-modulation (PWM) signals on GPIO pins


Write to servo motors connected to the Raspberry Pi hardware


Use the Linux® command shell and manage files on Raspberry Pi hardware


Use the Raspberry Pi’s display


Use the Raspberry Pi audio player and capture


Read data from sensors