imaqreset vid= videoinput('winvideo',2); preview(vid) sn=getsnapshot(vid); imshow(sn);