MATLAB: Data

change

Hi there, I have a 6 million x 1 array of prices. I want to change it so that it is +1 if P+1 > P, -1 if P-1 <P and 0 if P+1=P

Best Answer

sign(diff(P));