This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Determine whether video input object is logging


bool = islogging(obj)


bool = islogging(obj) returns true if the video input object obj is logging data, otherwise false. A video input object is logging if the value of its Logging property is set to 'on'.

If obj is an array of video input objects, bool is a logical array where each element in bool represents the corresponding element in obj. If an object in obj is logging data, islogging sets the corresponding element in bool to true, otherwise false. If any of the video input objects in obj is invalid, islogging returns an error.


Create a video input object.

vid = videoinput('winvideo');

To put the video input object in a logging state, start acquiring data. The example acquires 50 frames to increase the amount of time that the object remains in logging state.

vid.FramesPerTrigger = 50

When the call to the start function returns, and the object is still acquiring data, use islogging to check the state of the object.

bool = islogging(vid)
bool =


Create a second video input object.

vid2 = videoinput('winvideo');

Start one of the video input objects again, such as vid, and use islogging to determine which of the two objects is logging.

bool = islogging([vid vid2])

bool =

     1     0

Introduced before R2006a