You are correct that the slope is the difference between the elements. Running the code in highlight execution might help illustrate the data flow. The reference is actually supposed to be a local variable but is converted with the snippet. See the screenshot below for the local variable correction.

Regards,
h_baker
National Instruments
Applications Engineer