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

 Respuesta aceptada

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 comentarios

In the code i have x as a decision variable (without any values) of k=10 elements. any ideas ?
x = sym('x',[1 10])
x = 
d = x(1:end-1)-x(2:end)
d = 

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Debugging and Improving Code en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Etiquetas

Preguntada:

el 15 de Nov. de 2022

Comentada:

el 15 de Nov. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by