Hello, I am trying to perform the following code on a dataset:
Dataset[1]=-1;
For [i=2,i<7000,i++,
Dataset[i]=Dataset[i-1]+Dataset[i+1]
]
The only way i can see to make this happen is to convert the dataset into an array and performing the loop. Here is a sample of the Dataset: {-1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, -1, \ 0, 0, 1, -1, 1, 0, -1, 1, 1, -1, 1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 1, 1, 1,....} Here is the result i wanna achieve: {-1, -1, 0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 6, 6, 7, 8, 9, 8, 8, \ 8, 9, 8, 9, 9, 8, 9, 10, 9, 10, 10, 10, 10, 10, 10, 9, 9, 9, 8, 9, 10,....}
I wanna store the result in the dataset as i am performing further operations on it afterwards. Any help would be appreciated. Thanks.