deleteFile
Delete file on target hardware
Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.
Description
Examples
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')
Create a connection from the MATLAB to the Raspberry Pi board. 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.
mypi = raspi;
Create a connection, mycamera
, 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.
mycamera = cameraboard(mypi,"Resolution","1280x720")
mycamera = Cameraboard with Properties: Name: Camera Board Resolution: "1280x720" (View available resolutions) Quality: 10 (1 to 100) Rotation: 0 (0 or 180) HorizontalFlip: 0 VerticalFlip: 0 FrameRate: 30 (2 to 90) 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: "normal" (View available exposure modes) ExposureCompensation: 0 (-10 to 10) AWBMode: "indoor" (View available AWB modes) MeteringMode: "average" (View available metering modes) Effects 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(mycamera); 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.
mycamera.Rotation = 180
You can use the same approach to change the values of other
cameraboard
properties.
Record a 60 second video.
record(mycamera,"myvideo.h264",60)
Stop the recording immediately.
stop(mycamera)
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
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
See Also
system
| openShell
| getFile
| putFile
| cameraboard
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)