How can I delete elements in a vector depending on the difference between them?
古いコメントを表示
Hi
I would like to delete certain elements in a vector so that I end up with a vector in which the difference between one element and the consecutive one is bigger than a given treshold?
Example:
a = [1 2 3 4 5 6 7 8 9];
treshold = 2;
And I want to end up with b = [1 4 7];
Many thanks in advance.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Other Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!