Main Content


Close IP camera preview window



closePreview(cam) closes the IP camera preview window for the ipcam object cam. You can close the preview at any time using the closePreview function. If you do not explicitly close the preview, it closes when you clear the ipcam object.


collapse all

You can open or close the IP camera preview window any time after creating the ipcam object.

Create an object, cam, using the URL of the IP camera. The URL address is for a Motion JPEG (mjpeg) HTTP stream.

cam = ipcam('')
cam = 

Display Summary for ipcam:

             URL: ''
        Username: ''
        Password: ''
         Timeout: 10

Preview the image from the camera.


The preview window opens and displays live video stream from your camera. The banner of the preview window shows the camera URL. The lower portion of the window shows the timestamp in seconds, resolution, and the frame rate in frames per second. Timestamp is the elapsed time since the object was created.

Close the preview.


The preview window closes.

Version History

Introduced in R2015a