% Acquiring a Single Image in a Loop
camList = webcamlist
% Connect to the webcam.
cam = webcam(1)
preview(cam);
pause(15)
img = snapshot(cam);

% Display the frame in a figure window.
image(img);
for idx = 1:5
    img = snapshot(cam);
    image(img);
    pause(2)
end

clear cam