필터 지우기
필터 지우기

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 CenterFile Exchange에서 Get 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