フィルターのクリア

How to receive the inverse of the diff(x) array calculation ?

2 ビュー (過去 30 日間)
Anwar
Anwar 2022 年 11 月 15 日
コメント済み: Torsten 2022 年 11 月 15 日
For example ,if x=[a,b,c,d] and diff(x)=[b-a,c-b,d-c],
is there any possible way for [a-b,b-c,c-d].

採用された回答

Torsten
Torsten 2022 年 11 月 15 日
x = [4 6 9 13];
s1 = -diff(x)
s1 = 1×3
-2 -3 -4
s2 = [x(1)-x(2),x(2)-x(3),x(3)-x(4)]
s2 = 1×3
-2 -3 -4
  2 件のコメント
Anwar
Anwar 2022 年 11 月 15 日
In the code i have x as a decision variable (without any values) of k=10 elements. any ideas ?
Torsten
Torsten 2022 年 11 月 15 日
x = sym('x',[1 10])
x = 
d = x(1:end-1)-x(2:end)
d = 

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by