Main Content

putFile

Transfer file from host computer to target hardware

Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.

Description

putFile(mypi,source) copies the specified file from the MATLAB® Current Folder to the current folder (pwd) on the Raspberry Pi® hardware. Wildcards are supported. This function is not supported in MATLAB Online™.

putFile(mypi,source,destination) copies the file to a destination path and optional file name. This function is not supported in MATLAB Online.

example

Examples

collapse all

You can copy a file, such as out.jpg, from your host computer to the Raspberry Pi hardware. Use the different file and path conventions of each operating system.

putFile(mypi,'C:\Work\.profile','/home/pi/.profile')

Input Arguments

collapse all

Connection to the Raspberry Pi hardware board, specified as a raspi object.

Path and name of the file on the host computer. Specify the path as a string. You can use an absolute path or a relative path from the MATLAB Current Folder. Use the path and file naming conventions of the operating system on your host computer.

Example: 'C:\Work\.profile'

Data Types: char

Destination folder path and optional file name, specified as a string. Use the Linux® path and file naming conventions. Optional.

Example: '/home/pi/.profile'

Data Types: char