I have a vector:
A = [1 2 3 4 5];
I want to find the difference between A(1) and the remaining indices:
A(1) = 1; 1 – A = [0 -1 -2 -3 -4]
I then want to continue to A(2) and until the end of the vector. So that I have the differenced between all points from each other.
At the moment I use loops but it is very time consuming. How can I do this using vectorization techniques to improve performance?
Many thanks! MATLAB 2016a
Best Answer