Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: continuous acquisition
Date: Wed, 5 Dec 2007 14:34:56 +0000 (UTC)
Organization: DW-TV
Lines: 39
Message-ID: <fj6cug$2vu$1@fred.mathworks.com>
References: <fj60m2$p81$1@fred.mathworks.com> <fj66ch$sgs$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1196865296 3070 172.30.248.37 (5 Dec 2007 14:34:56 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 5 Dec 2007 14:34:56 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1095707
Xref: news.mathworks.com comp.soft-sys.matlab:440958



"Lars Warmbold" <mustermann.klaus.TO.REMOVE@gmx.de> wrote in
message <fj66ch$sgs$1@fred.mathworks.com>...
> %% Create TWO *.m-files from this functions
> 
> % first *.m-file
> function plotaqcuiredata
> 
> N = 1024;
> SampRate= 44100;
> 
> %% Create Plot
> figure(1)
> hPlot = plot(zeros(1,N));
> axis([0 N -2 2]);
> grid on;
> 
> %% create 'LineIn'
> ai      = analoginput('winsound');
> chan    = addchannel(ai,1);
> 
> handles.N     = N;
> handles.ai    = ai;
> handles.hPlot = hPlot;
> 
> %% config LineIn
> set(ai,'SampleRate'             , SampRate);
> set(ai,'SamplesPerTrigger'      , inf);
> set(ai,'SamplesAcquiredFcnCount', N);
> set(ai,'SamplesAcquiredFcn'     , {@update_plot, handles});
> 
> 
> start(ai);
> pause(5);
> stop(ai);
> 
%% insert here:
delete(ai);