Documentation Center

  • Trial Software
  • Product Updates

deleteFile

Delete file on target hardware

Syntax

  • deleteFile(mypi,fileName)

Description

deleteFile(mypi,fileName)

Examples

expand all

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') 

Use the Camera Board

You can create a connection to the Camera Board, take a photograph, and record video.

Create a connection to the Raspberry Pi board.

mypi = raspi;

Create a connection to the Camera Board while changing the resolution, and assign that connection to a handle, mycam. The handle 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])

Import and display a sequence of ten snapshots on your host computer.

for ii = 1:10
img = snapshot(mycam);
    imagesc(img);
    drawnow;
end

If the image is upside down, change the orientation of the image.

mycam.Rotation = 180;

You can use the same approach to change the values of many mycamera properties listed in the "Name-Value Pair Arguments" for cameraboard.

Record a 60 second video.

record(mycam,'myvideo.mp4',60)

Stop recording before the 60 seconds have elapsed.

stop(mycam)

Copy the video from the board to your host computer.

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

Delete the video file from the board to free up space.

deleteFile(mypi,'myvideo.mp4')

Input Arguments

expand all

mypi — Connection to specific boardhandle

Connection to a specific board, specified as a handle.

Use raspi to create this connection.

Example: mypi

fileName — File to deletefile 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.

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

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

Data Types: cell

See Also

| | | |

Was this topic helpful?