Using a Raspberry Pi with MATLAB Online
Get started using a Raspberry Pi™ with MATLAB Online™. Set up a Raspberry Pi in the terminal app to allow MATLAB Online connections. Then you can remotely access your Raspberry Pi from anywhere that has an Internet connection after setup is complete. Discover the features for the Raspberry Pi with MATLAB Online.
Published: 23 Jul 2019
In this video, I will show you how to setup your Raspberry Pi™ to use with MATLAB Online™, so you can remotely connect to your device from anywhere. You will need a Raspberry Pi with Raspbian configured with Internet. It's recommended to change your default username and password for security before you connect to the Internet.
Open the terminal on the Raspberry Pi if you have a monitor and keyboard directly connected, or remotely access the Raspberry Pi via SSH.
Now, enter this command to update your Raspberry Pi repo:
$ sudo apt-get update
Enter this command to install the MATLAB Raspberry Pi package:
$ sudo apt-get install matlab-rpi
For the installation to complete, type “y
” and then “enter
”.
Run this command to configure MATLAB Online connections:
$ sudo matlab-rpi-setup
You can enter a display name for your device in MATLAB Online. Enable peripherals you want by typing “y
” and then “enter
”. Enter your MathWorks account username and password. If you ever want to change these settings, just use the setup command again.
Reboot your Raspberry Pi, so the configuration can take effect. Now, you can connect to your Raspberry Pi to MATLAB Online from anywhere as long as it has an Internet connection.
In MATLAB Online, enter the same MathWorks credentials to sign in.
In the command window, type the command: raspilist
. This will show you the online Raspberry Pis that you configured in the setup with your MathWorks account.
The function raspi()
creates a connection to the Pi. You can also specify which one to connect to if there are multiple Pi’s available.
Once we connect, we can see the properties and the available peripherals we can use.
If you enter the command showLEDs(),
you can see a diagram of the Raspberry Pi with the available LED. There is a similar command called showPins(),
where you can see all of the available pins in the diagram.
For more help, please refer to the documentation "Connect to Raspberry Pi in MATLAB Online".
Up Next:
Related Videos:
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)