thanks a ot Tom.. It s working..
On the other hand, I was trying to understand the code so that it helps improving my ability. Actually i have problem with remainder vi which, i guess, controls the averaging process. I looked for example but couldnt find so. I just realized that in the code that u modified my ramping machine is not working properly as i want. Thats why I simplified it and working better ( u can see the attachment). Now it counts 4,3,2,1,0,-1,-2,-3,-4,-4,-3,-2,-1,0,1,2,3,4,4...
so at the beginning i can determine of how many element ll be in the first spectrum, second and so on (18 elemnts for above example). So what I was trying to implement ur averaging process into this new code. I tried to feed the reaminder vi with array length corresponding 1 single spectrum. Although i have struggled all night along, i couldnt manage it:( What is the trick?