I have a row vector like so: [1 5 6 -4 3]
. I want to find means of absolute values of second difference between elements. The second differences in this example are (6-1)=5 ,-4-5=-9 & 3-6=-3
, and the average absolute mean is (5+9+3)/3=17/3
.
Is there some way of using MATLAB's efficient matrix/array manipulation to do this nicely?