I am trying to devide the values between a vector elements by 0.1. Assume x = [1,4,-1,5,0,-2]. I want to create a vector with that:
If x(k) > x(k-1) : increment by 0.1 ----> x(k-1) : 0.1 : x(k)
if x(k) < x(k-1) : decrement by 0.1 ----> x(k-1) : -0.1 : x(k)
In my attempt, it only shows the results between last two elements (0 and -2), but I need the values for the elements.
Any help is appreciated. Thanks!
x = [1,4,-1,5,0,2];
if x(k) > x(k-1)
vt = v(k-1):0.1:v(k);
vt = x(k-1):-0.1:x(k);