Path: news.mathworks.com!not-for-mail
From: "Davide Borelli" <davidepub@microonda.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: continuous acquisition
Date: Tue, 11 Dec 2007 15:27:43 +0000 (UTC)
Organization: Universita di Parma
Lines: 93
Message-ID: <fjma9f$8d4$1@fred.mathworks.com>
References: <fj60m2$p81$1@fred.mathworks.com> <fj66ch$sgs$1@fred.mathworks.com> <fj6cug$2vu$1@fred.mathworks.com> <fj9d6l$97$1@fred.mathworks.com> <fjb0ua$cfc$1@fred.mathworks.com> <fjbaqs$mu0$1@fred.mathworks.com> <fjbgs7$ggp$1@fred.mathworks.com> <fjbr8b$qi7$1@fred.mathworks.com>
Reply-To: "Davide Borelli" <davidepub@microonda.net>
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 1197386863 8612 172.30.248.37 (11 Dec 2007 15:27:43 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 Dec 2007 15:27:43 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1205384
Xref: news.mathworks.com comp.soft-sys.matlab:441994



I made it!
Now I have another problem: I want to acquire 100 samples 
(at 50000 samples per second) and plot the mean values.
I tried this code for the update_plot.m file:


function update_plot(dummy1,dummy2,handles)
% GET ACQUIRED DATA FROM ai-OBJECT
data=getdata(handles.ai,handles.SamplesNumber);
Media=mean(data);
handles.Volt(:)=Media;

%PLOT DATA IN THE GUIDE WINDOW
axes(handles.PlotChannel);
plot(handles.Volt);


but every time I run the program I see handles.Volt is not 
a vector with increasing dimension but a 1x1 vector, i.e. 
a scalar. How can I do to make the update_plot.m file to 
keep de data in an array, in order to save it in a file at 
the end of the measure?

Thank you
Davide B.





"Davide Borelli" <davidepub@microonda.net> wrote in 
message <fjbr8b$qi7$1@fred.mathworks.com>...
> Ok, thank you, I had not read carefully your previous 
> answer to my post. I will try with the two separate .m 
> file (just a curiosity: what is the difference between 
> making two different files and putting that in two 
> different functions in the same file?).
> Thank you very much
> Davide B.
> 
> 
> "Lars Warmbold" <mustermann.klaus.TO.REMOVE@gmx.de> 
wrote 
> in message <fjbgs7$ggp$1@fred.mathworks.com>...
> > "Davide Borelli" <davidepub@microonda.net> wrote in 
> message
> > <fjbaqs$mu0$1@fred.mathworks.com>...
> > > Yes, I already use the acquisition toolbox to 
acquire 
> with 
> > > Matlab.
> > > My question was different: which kind of code should 
I 
> use 
> > > to make a continuous acquisition like the one you 
make 
> > > with a soundcard? I would like to see the structure 
of 
> a 
> > > program designed for a continuous acquisition like 
> that, 
> > > because I have a m-file which doesn't allow to make 
> > > continuous acquisition, but several very short (and 
> > > possibly fast) acquisition.
> > > Davide B.
> > > 
> > 
> > I don't understand your Problem, cause the provided 
code
> > does exactly what you want. Just replace 
> > 
> > >> pause(5)
> > >> stop(ai) 
> > 
> > by some other control (i.E. stop button in GUI) or 
> remove them. 
> > 
> > Once you started 'ai' it runs infinitely. You can also 
> type 
> > 
> > >> stop(ai)
> > 
> > into the command window when aqcuisition is done.
> > 
> > The code I provided plots the data and deletes them. 
If 
> you
> > want to store them, you should look after the log to 
disk
> > mode of analoginput.
> > LARS
>