making three waves from every 3 elements of a wave?

Hello Forum,

This question is simple, but I'm new to igor. I have a wave0 which has some data points and i want to make three new waves (wave1, wave2, wave3) that have elements of wave0 such that wave1 has elements 0th, 3rd , 6th .... and so on; wave 2 has elements 1st,4th,7th ... and so on; wave 3 has elements 2nd, 5th, 8th... and so on. In other words create three waves that have every three elements of wave0 in order.

I learned how to make two waves that has 2 points of wave0 , by using odds and even simple code

make /n=100 wave0=x
make /n=(numpnts(wave0)/2) wave1
make /n=(numpnts(wave0)/2) wave2
wave1[]=wave0[2*p]
wave2[]=wave0[2*p+1]

is there a similar simple code to make it for every three elements or should I make a loop ?

Your help is appreciated.

you mean like this?

make /n=300 wave0=x
make /n=(numpnts(wave0)/3) wave1
make /n=(numpnts(wave0)/3) wave2
make /n=(numpnts(wave0)/3) wave3
wave1[]=wave0[3*p]
wave2[]=wave0[3*p+1]
wave2[]=wave0[3*p+2]

 

I can't help offering a tricky solution :)

make/n=3000 junk=p
Redimension/N=(3,1000) junk
matrixTranspose junk
•Splitwave junk

Note that this technique requires that the wave (junk, in this case) have a number of rows that is divisible by three.