Main Content

deleteFile

Delete file on target hardware

Description

deleteFile(mypi,filename) deletes the specified file from the target hardware.

Note

To generate C/C++ code for this function, you must have an Embedded Coder® license.

example

Examples

collapse all

You can delete a file on the Raspberry Pi® hardware.

deleteFile(mypi,'/home/pi/cap.jpg')

You can delete multiple files on the Raspberry Pi hardware using a wildcard character, *.

deleteFile(mypi,'/home/pi/*.jpg') 

You can delete files on the Raspberry Pi hardware when connected to it from MATLAB® Online™. To use your hardware from MATLAB Online, follow the instructions in Connect to Raspberry Pi Hardware Board in MATLAB Online.

When connected to your hardware from MATLAB Online, the default working directory is /home/matlabrpi, instead of /home/pi. This is the only directory you can delete files from. Delete a file in /home/matlabrpi by using the file name as an input argument.

deleteFile(mypi,'myvideo.h264')

Input Arguments

collapse all

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

File to delete, specified as a string. You can delete a file on the Raspberry Pi hardware. When you specify the file name, you can use path information and wildcards. In MATLAB Online, you can only delete files in the default working directory, /home/matlabrpi.

Example: '/home/pi/cap.jpg'

Example: '/home/pi/*.jpg'

Example: 'myvideo.h264'

Data Types: cell

Extended Capabilities

expand all

Version History

Introduced in R2014b