MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Multiple application of LinearFilter


Lea,

 Use NestList or Nest as shown below:

<<Statistics`DataSmoothing`

data1 = {7.,4.,5.,3.,8.,5.,2.,3.,6.,8.};

This function displays the data after each pass through the filter, up
to n passes:

myFilter[n_Integer]:=NestList[LinearFilter[#,{1/2,1/2}]&,data1,n]

myFilter[4]

This function displays the data after n passes through the filter:

myFilter2[n_Integer]:=Nest[LinearFilter[#,{1/2,1/2}]&,data1,n]

myFilter2[4]

Hope this helps,

Cheers,

Brian


  • Prev by Date: mathematica to word
  • Next by Date: Re: three column output
  • Previous by thread: Re: Multiple application of LinearFilter
  • Next by thread: Re: Multiple application of LinearFilter