Remove image acquisition object from memory
delete(obj) removes obj, an image acquisition object or array of image acquisition objects, from memory. Use delete to free memory at the end of an image acquisition session.
If obj is an array of image acquisition objects and one of the objects cannot be deleted, the delete function deletes the objects that can be deleted and returns a warning.
When obj is deleted, it becomes invalid and cannot be reused. Use the clear command to remove invalid image acquisition objects from the MATLAB® workspace.
If multiple references to an image acquisition object exist in the workspace, deleting the image acquisition object invalidates the remaining references. Use the clear command to delete the remaining references to the object from the workspace.
If the image acquisition object obj is running or being previewed, the delete function stops the object and closes the preview window before deleting it.
Create a video object, preview the object, then delete the object:
vid = videoinput('winvideo', 1); preview(vid); delete(vid);