obj = videoinput('winvideo',1,'MJPG_640x480'); vidRes = obj.VideoResolution; nBands = obj.NumberOfBands; hImage = image( zeros(vidRes(2), vidRes(1), nBands) ); preview(obj, hImage);