alternative to diff(X)

Hi there, is there anyother 1 line method to diff(X), as diff is not supported in the gpu arrayfun!
Thanks

 採用された回答

Honglei Chen
Honglei Chen 2012 年 4 月 26 日

1 投票

x = 1:10;
x(2:end)-x(1:end-1)

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by