User`s guide

Logging Image Data to Disk
vid.DiskLoggerFrameCount
ans =
40
Note Becauseittakeslongertowriteframestoadiskfilethantomemory,
the value of the
DiskLoggerFrameCount property can lag behind the value
of the
FramesAvailable property, which specifies the number o f frames
logged to memory.
To verify that a dis k file was created, go to the directory in which the log
file resides and make sure it exis ts. The
exist function returns 2 if the
file exists.
if(exist(my_log)==2)
disp('AVI file create d.')
6 ClosetheAVIfileobject Close the AVI file to make it available
outside the MATLAB environment. Closing the AVI file object ensures that
theloggeddataiswrittentothediskfile. Besuretousethevalueofthe
video input object
DiskLogger property, vid .DiskLogger, to reference the
AV I file object, not the original variable,
aviobj, returned by the av ifil e
function.
aviobj = close(vid.Di skLogger);
Use the original variable, aviobj, as the return value when closing an
AVI file object.
7 Clean up Always rem ove image acquisition objects from mem ory, and
the variables that re ference them, when you n o longer need them.
delete(vid)
clear vid
5-45