Subtracting element from previous element within a list.
Could someone please help me figure out how to perform a calculation on a list of numbers, where each element in the list is subtracted from the previous element to generate a new list of differences.
For example, if I have an input list of 2 4 6 7, i would like to generate a list of 2 2 1 by subtracting 2 from 4, 4 from 6, and 6 from 7.
Please note that the input list length will vary with different examples as this list will be dynamically generated.
Thanks in advance.
you need to iter the list and form pairs of numbers to perform calculation.
remove 1st result, because it will contain last item from previous list.
Max Patch
Copy patch and select New From Clipboard in Max.
Something like this?
Surely could be done in a more elegant way. A rapid one:
Max Patch
Copy patch and select New From Clipboard in Max.
My take...
Max Patch
Copy patch and select New From Clipboard in Max.
thanks, this is great.