MATLAB: One formula in Matlab.

statistics formula

Hi everyone. Is there any function in Matlab that can easily calculate such kind of formula (Y[i]-Y[i-1])/Y[i-1] ?

Best Answer

No. However, you can use
diff(Y) ./ Y(1:end-1)