フィルターのクリア

Subtracting specific places in vector using diff

4 ビュー (過去 30 日間)
sani
sani 2021 年 5 月 9 日
コメント済み: sani 2021 年 5 月 10 日
Hi, I'm using the function diff to subtract elements in a vector. I read the docomentation and I don't think I get it well and hopefuly someone can explein it to me. can I use the diff function to subtrat between the enen places with the odd olace before it (x(2)-x(1),x(4)-x(3) and so on)? 1- is it possible? 2 - what does diff(X,n) does exactly? thanks

採用された回答

Matt J
Matt J 2021 年 5 月 9 日
編集済み: Matt J 2021 年 5 月 9 日
1- Not with |diff(). If you wanted to do that, it would be
x(2:2:end)-x(1:2:end)
2. diff(X,n) approsimates the n-th derivative of X using finite differences.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by