Path: news.mathworks.com!not-for-mail
From: "Talal Khan" <talaltk@mathwork.com>
Newsgroups: comp.soft-sys.matlab
Subject: *HELP* Problem with videoinput, preview statement
Date: Sun, 13 Jan 2008 23:12:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 32
Message-ID: <fme5s2$kk9$1@fred.mathworks.com>
Reply-To: "Talal Khan" <talaltk@mathwork.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1200265922 21129 172.30.248.35 (13 Jan 2008 23:12:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 13 Jan 2008 23:12:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1244142
Xref: news.mathworks.com comp.soft-sys.matlab:445559


I use this piece of code and it works perfectly in the 
matlab environment, however when i make an executable out 
of it,it gives me an error saying
----------------------------------------------
Function 'preview' is not defined for a first argument of 
class 'videoinput'.
----------------------------------------------
-------------
MY CODE IS:
------------

vid = videoinput('winvideo');

preview(vid);

pause;

frame = getsnapshot(vid);

subplot(1,1,1);imshow(frame,'InitialMagnification','fit');

%save file
 saveas(gca,'TTT.jpeg')
 delete(vid);
 
 closepreview;

-----------------------------------------------
MATLAB VERSION 7.0.1.24704 (R14) Service Pack 1
------------------------------------------------
Image Axquisition Toolbox  1.7 
-------------------------------------------------