One formula in Matlab.

2 views (last 30 days)
Artyom
Artyom on 17 Jul 2012
Hi everyone. Is there any function in Matlab that can easily calculate such kind of formula (Y[i]-Y[i-1])/Y[i-1] ?

Accepted Answer

Walter Roberson
Walter Roberson on 17 Jul 2012
No. However, you can use
diff(Y) ./ Y(1:end-1)

More Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!