Main Content

getselectedsource

Return currently selected video source object

Description

src = getselectedsource(obj) searches all the video source objects associated with the video input object obj and returns the video source object, src, that has the Selected property value set to 'on'.

To select a source for acquisition, use the SelectedSourceName property of the video input object.

example

Examples

collapse all

Construct a video input object.

obj = videoinput("gentl", 1);

Return the currently selected video source object for the video input.

src = getselectedsource(obj);

Display information about the selected source object.

whos src
  Name      Size            Bytes  Class          Attributes

  src       1x1                 8  videosource              

Input Arguments

collapse all

Video input object, specified as a 1-by-1 videoinput object.

Output Arguments

collapse all

Video source with its Selected property value set to 'on', returned as a video source object.

Version History

Introduced before R2006a

See Also