Hi all

I have a list of 20 numbers and I have to write a program that takes the first 3 numbers, calculate the median and shoots out the median in table format. Then the program takes numbers 2,3,4 and calculate the median and shoots it into a table. Then numbers 3,4,5 and so on until all 20 numbers have been used.

Any ideas how to implement this?

Here is a set of data for you to try your program out on:

{0.00, -0.07, 0.08, -0.01, 1.44, 0.00, 0.00, 0.07, -0.01, 0.00, 0.97,

0.96, 1.02, 0.93, 0.9, 0.24, 1.01, 1.04, 1.01, 1.02}

The correctly filtered data is:

{0.00, -0.07, 0.00, -0.01, 0.08, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,

0.96, 0.97, 0.96, 0.93, 0.90, 0.90, 1.01, 1.01, 1.02}

Time step Input Moving window Output

0 0.00 ( 0.00, , ) 0.00

1 -0.07 (-0.07, 0.00, ) -0.07

2 0.08 ( 0.08, -0.07, 0.00) 0.00

3 -0.01 ( -0.01, 0.08, -0.07) -0.01

Etc....

Thank in advance