Hi,
I have an 1D array with depth values (say from 0 to 5cm). The user will input an amount to shift the depth (say shift=2cm). How would I then use the value to produce a second array that has the depth from 1 to 3cm and then have zeros in the elements after 3cm so that the new array is the same size as he original?
Such as:
a[0]: 0
a[1]: 1
a[2]: 2
a[3]: 3
a[4]: 4
a[5]: 5
becomes:
a[0]: 2
a[1]: 3
a[2]: 4
a[3]: 5
a[4]: 0
a[5]: 0
Thanks for your help!



LinkBack URL
About LinkBacks




