%% Open and Close Video File for Writing
% Create a VideoWriter object to write a new Motion JPEG AVI file.

v = VideoWriter('newfile');

%
% Open the file for writing.

open(v)

%
% Write a 300-by-300 matrix of data to the file.

writeVideo(v,rand(300))

%
% Close the file.

close(v)

% Copyright 2015 The MathWorks, Inc.