alternative to diff(X)

4 views (last 30 days)
Mate 2u
Mate 2u on 26 Apr 2012
Hi there, is there anyother 1 line method to diff(X), as diff is not supported in the gpu arrayfun!
Thanks

Accepted Answer

Honglei Chen
Honglei Chen on 26 Apr 2012
x = 1:10;
x(2:end)-x(1:end-1)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!