Path: news.mathworks.com!not-for-mail
From: "Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi>
Newsgroups: comp.soft-sys.matlab
Subject: Re: filtering data problem
Date: Fri, 24 Apr 2009 07:16:03 +0000 (UTC)
Organization: Tampere University of Technology
Lines: 31
Message-ID: <gsrovj$not$1@fred.mathworks.com>
References: <gsoc01$eog$1@fred.mathworks.com> <gsp1tf$bno$1@fred.mathworks.com> <gsp87p$cdu$1@fred.mathworks.com> <gsrmsm$5pv$1@fred.mathworks.com> <gsroif$dt$1@fred.mathworks.com>
Reply-To: "Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1240557363 24349 172.30.248.38 (24 Apr 2009 07:16:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 24 Apr 2009 07:16:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 218565
Xref: news.mathworks.com comp.soft-sys.matlab:535128


"Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi> wrote in message <gsroif$dt$1@fred.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gsrmsm$5pv$1@fred.mathworks.com>...
> > "Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi> wrote in message <gsp87p$cdu$1@fred.mathworks.com>...
> > > "Jos " <#10584@fileexchange.com> wrote in message <gsp1tf$bno$1@fred.mathworks.com>...
> > 
> > > 
> > > Does enybody know what really happens in this kind of loop?
> > > Each time when  an element is removed (assigned to empty), does MATLAB have to find a new contiguous memory block for the new slightly smaller array? Thus fragmenting memory. 
> > 
> > Yes it does (Using my own PrintPtr mex command to track data pointer):
> > 
> > >> a=[1:10]
> > a =
> >      1     2     3     4     5     6     7     8     9    10
> > 
> > >> PrintPtr(a)
> > Ptr=0E23B720x
> >  
> > >> a(1)=[]
> > a =
> >      2     3     4     5     6     7     8     9    10
> > 
> > >> PrintPtr(a)
> > Ptr=0E3F1790x % <- it changes
> > 
> > Bruno
> 
> Just what I thought, thanks.
> Would that PrintPtr be available? It would be handy sometimes to see what actually happens in the memory.

Forget the previous. I only serched FEX before posting. Found it two minutes after that.