Hi Rajini,
To acquire images from a webcam, you first create a webcam object. Use the webcam function to create the object. You can use it in three ways:
- Connect to the first or only camera by using no input arguments
- Specify a camera by name by using the webcam name (as a character vector) in an input argument
- Specify a camera by the list order using an index number as the input argument
You can learn more about acquiring images from webcams from this MathWorks resource -
Hope this helps!