Error capturing webcam image in matlab
<p>I got this error when I tried to capture image using my pc webcam. I am new to matlab. How can I fix this error? </p>

<blockquote>
  <p>Error using imaq.VideoDevice
  No device is available for the specified ADAPTORNAME. See IMAQHWINFO('dcam').</p>
  
  <p>Error in maina1 (line 4)
  obj =imaq.VideoDevice('dcam', 1, 'YUYV_320x240','ROI', [1 1 320 240]);</p>
</blockquote>

<p>This is my code,</p>

<pre><code>obj =imaq.VideoDevice('dcam', 1, 'YUYV_320x240','ROI', [1 1 320 240]); set(obj,'ReturnedColorSpace', 'rgb'); figure('menubar','none','tag','webcam');
</code></pre>

<p>This is the answers I got when I run 'imaqhwinfo' and 'webcamlist'</p>

<pre><code>&gt;imaqhwinfo

ans = 

InstalledAdaptors: {'dcam'}
    MATLABVersion: '8.6 (R2015b)'
      ToolboxName: 'Image Acquisition Toolbox'
   ToolboxVersion: '4.10 (R2015b)'

&gt; webcamlist

ans = 

'Integrated Webcam'
</code></pre>