deleteFile
Delete file on target hardware
Description
Examples
Delete File on Raspberry Pi Hardware
You can delete a file on the Raspberry Pi® hardware.
deleteFile(mypi,'/home/pi/cap.jpg')
Delete Multiple Files on Raspberry Pi Hardware
You can delete multiple files on the Raspberry Pi hardware
using a wildcard character, *
.
deleteFile(mypi,'/home/pi/*.jpg')
Delete File on Raspberry Pi Hardware in MATLAB Online
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')
Use the Camera Board
You can connect to the camera board on the Raspberry Pi hardware, from the MATLAB software, take a photograph, and record video.
Create a connection from the MATLAB software to the Raspberry Pi hardware.
mypi = raspi
Note
If you encounter errors after running the above command, try using additional
arguments (as listed in raspi
) or refer to Troubleshoot Connecting Issues to Raspberry Pi Hardware.
Create a connection, mycam
, from the MATLAB software to the camera board on the Raspberry Pi hardware, and set the image
resolution. The connection displays the camera board properties.
mycam = cameraboard(mypi,'Resolution','1280x720')
mycam = Cameraboard with Properties: Name: Camera Board Resolution: '1280x720' (View available resolutions) Quality: 10 (1 to 100) Rotation: 0 (0, 90, 180 or 270) HorizontalFlip: 0 VerticalFlip: 0 FrameRate: 30 (2 to 30) Recording: 0 Picture Settings Brightness: 50 (0 to 100) Contrast: 0 (-100 to 100) Saturation: 0 (-100 to 100) Sharpness: 0 (-100 to 100) Exposure and AWB ExposureMode: 'auto' (View available exposure modes) ExposureCompensation: 0 (-10 to 10) AWBMode: 'auto' (View available AWB modes) MeteringMode: 'average' (View available metering modes) Effects ImageEffect: 'none' (View available image effects) VideoStabilization: 'off' ROI: [0.00 0.00 1.00 1.00] (0.0 to 1.0 [top, left, width, height])
Capture and display a sequence of 10 snapshots on your computer.
for ii = 1:10 img = snapshot(mycam) imagesc(img) drawnow end
Each of the 10 snapshots is the latest image captured by the camera.
If the image is upside down, change its orientation.
mycam.Rotation = 180
You can use the same approach to change the values of other
cameraboard
properties.
Record a 60 second video.
record(mycam,'myvideo.h264',60)
Stop the recording immediately.
stop(mycam)
Copy the video from the board to your computer.
getFile(mypi,'myvideo.h264','C:\MATLAB ')
Delete the video file from the hardware to free up space.
deleteFile(mypi,'myvideo.h264')
Input Arguments
mypi
— Connection to specific Raspberry Pi hardware board
raspi object
Connection to a specific Raspberry Pi hardware board, specified
as a raspi
object.
filename
— File to delete
file name
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
See Also
system
| openShell
| getFile
| putFile
| cameraboard
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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)