Subtracting consecutive points on a row in igor

36 views Asked by At

I have thousands of data points and I want to subtract two consecutive points and add the value to a new column. I tried to idex the row but it seems like igor doesn't work same way as python. Is there a cmd line that will calculate the change of consecutive data points? Say for instance I have a data

wave0= 1 3 8 9 12 18

And I want

wave1= 2 5 1 3 6
1

There are 1 answers

0
t-b On BEST ANSWER

You can use the p, q, r, s wave indexing in Igor Pro for that.

So something like

Make/O wave0 = {1, 3, 8, 9, 12, 18}
Make/O/N=5 wave1
wave1[] = wave0[p + 1] - wave0[p]

should do the trick.