User`s guide
Looking at the Demo Adaptor
1-11
Note Because the toolbox caches adaptor information, you might need to reset the
toolbox, using imaqreset, before a newly registered adaptor appears in the imaqhwinfo
listing.
For example, the following code registers the demo adaptor with the toolbox using
the imaqregister function, where <your_directory> represents the name of the
directory where you created the demo adaptor.
imaqregister('<your_directory>\mwdemoimaq.dll');
Running the Demo Adaptor
Start MATLAB and call the imaqhwinfo function. You should be able to see the demo
adaptor included in the adaptors listed in the InstalledAdaptors field. For example,
on a Windows system, imaqhwinfo returns the following.
ans =
InstalledAdaptors: {'demo' 'matrox' 'winvideo'}
MATLABVersion: '7.12 (R2011a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '4.1 (R2011a)'
Create a video input object with the demo adaptor.
vid = videoinput('demo');
Get a preview of the data being returned by the demo adaptor using the preview
function. Note that the demo adaptor generates a grayscale pattern to mimic the data
returned by a real image acquisition device. The demo adaptor does not connect to an
actual device.
preview(vid);