# Set up and Blink - MATLAB and Simulink with Raspberry Pi

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/024/296/medium800/raspberry_pi_RaspberryPiOverview.png?1428093536)

You can use MATLAB to communicate with a Raspberry Pi&nbsp;board and its peripheral devices using MATLAB Support Package for Raspberry Pi.

You can program Raspberry Pi&nbsp;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&nbsp;board.&nbsp;

This tutorial covers a step-by-step guide to:

MATLAB Support Package&nbsp;

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

Simulink Support Package

1. Set up the Simulink support package for&nbsp;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&nbsp;to blink an LED

This is the first tutorial in a series on using MATLAB and Simulink to program a&nbsp;Raspberry Pi.&nbsp;In this tutorial Raspberry Pi 2&nbsp;is used as an example, however the same steps can be used for other boards like Raspberry Pi Model B+&nbsp;etc.&nbsp;

http://www.youtube.com/watch?v=3Bcw2VzlFA0#t=0m47s

- [Next Page](https://learn.adafruit.com/how-to-use-matlab-and-simulink-with-raspberry-pi/parts-and-hardware.md)

## Featured Products

### Raspberry Pi 2 - Model B v1.2 - ARM Cortex-A53 with 1G RAM

[Raspberry Pi 2 - Model B v1.2 - ARM Cortex-A53 with 1G RAM](https://www.adafruit.com/product/2358)
Didn't think the Raspberry Pi could get any better? You're in for a big surprise! The Raspberry Pi 2 Model B is out and it's amazing! With an upgraded ARM Cortex-A53&nbsp;quad-core processor, Dual Core VideoCore IV Multimedia coprocessor, and a full Gigabyte of RAM, this...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2358)
[Related Guides to the Product](https://learn.adafruit.com/products/2358/guides)
### USB Patterned Fabric Cable - A/MicroB

[USB Patterned Fabric Cable - A/MicroB](https://www.adafruit.com/product/2008)
Oooh it's so soft! And that beautiful&nbsp;pattern! If you have to have visible cables&nbsp;then you might as well have the nicest fabric bound cable with a eye-catching snake-like pattern. &nbsp;That's why we now carry this standard A to micro-B USB cable&nbsp;for USB 1.1 or 2.0....

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2008)
[Related Guides to the Product](https://learn.adafruit.com/products/2008/guides)
### Ethernet Cable - 3 ft long

[Ethernet Cable - 3 ft long](https://www.adafruit.com/product/995)
We have so many Internet-connected goodies in the shop, we figured it's time to carry a cable so you can easily connect them up! This cable is 3 feet long, comes in Adafruit black and has all 8 wires installed. Perfect for use with the <a...></a...>

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/995)
[Related Guides to the Product](https://learn.adafruit.com/products/995/guides)

## Related Guides

- [Internet of Things Printer for Raspberry Pi](https://learn.adafruit.com/pi-thermal-printer.md)
- [Reverse Engineering a Bluetooth Low Energy Light Bulb](https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb.md)
- [Pi Box](https://learn.adafruit.com/pi-box.md)
- [DotStar Pi Painter](https://learn.adafruit.com/dotstar-pi-painter.md)
- [Retro Gaming with Raspberry Pi](https://learn.adafruit.com/retro-gaming-with-raspberry-pi.md)
- [Running Minecraft on a Raspberry Pi](https://learn.adafruit.com/running-minecraft-on-a-raspberry-pi.md)
- [Monitor PiCam and temperature on a PiTFT via adafruit.io](https://learn.adafruit.com/monitor-picam-and-temperature-on-a-pitft-via-adafruit-dot-io.md)
- [Running Programs Automatically on Your Tiny Computer](https://learn.adafruit.com/running-programs-automatically-on-your-tiny-computer.md)
- [Introducing the Raspberry Pi Model B+](https://learn.adafruit.com/introducing-the-raspberry-pi-model-b-plus-plus-differences-vs-model-b.md)
- [Controlling Motors using the Raspberry Pi and RasPiRobot Board V2](https://learn.adafruit.com/controlling-motors-using-the-raspberry-pi-and-raspirobot-board-v2.md)
- [Wood Case for Raspberry Pi 3](https://learn.adafruit.com/wood-case-for-raspberry-pi-3.md)
- [Raspberry Pi NFC Minecraft Blocks](https://learn.adafruit.com/raspberry-pi-nfc-minecraft-blocks.md)
- [Setting up a Raspberry Pi as a WiFi Access Point](https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point.md)
- [Processing on the Raspberry Pi & PiTFT](https://learn.adafruit.com/processing-on-the-raspberry-pi-and-pitft.md)
- [Analog Inputs for Raspberry Pi Using the MCP3008](https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi.md)
