Main Content

Manage Raspberry Pi Files

Note

某些Linux®functions are limited inMATLAB®Online™. SeeSecurity Considerations for Raspberry Pi in MATLAB Onlinefor details.

You can download files from, upload files to, and delete files from the Raspberry Pi™ hardware.

To download a file from the Raspberry Pi hardware to your host computer, use thegetFilefunction. Use the second argument to specify the path and name of the file.

system(mypi,'ls') getFile(mypi,'/home/pi/.profile')

By default,getFilesaves the file to the current folder in MATLAB. You can use a third argument to specify a download folder on your host computer.

getFile(mypi,'/home/pi/.profile','C:\Users\myusername\Desktop')
To upload a file to the Raspberry Pi hardware, use theputFilefunction.
putFile(mypi,'C:\Users\myusername\Desktop\.profile','/home/pi/')

If you use the Camera Board to record video, download the video file. Then, delete the file from the Raspberry Pi hardware.

getFile(mypi,'myvideo.h264','C:\MATLAB') deletFile (mypi'myvideo.h264')

For more information, seeLinux.