Howe can I subtract neighboring numbers?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Max Behr
el 7 de Jul. de 2019
Comentada: Max Behr
el 7 de Jul. de 2019
Hello,
I got a matrix like this:
>> z=[1,2,3,4]
z =
1 2 3 4
How can I substract the neighboring numbers?
Like 2-1; 3-2; 4-3; etc.
And how can I divide every number by 60 ?
Like 1/60 2/60 etc
0 comentarios
Respuesta aceptada
Andrei Bobrov
el 7 de Jul. de 2019
diff(z)
z/60
5 comentarios
Andrei Bobrov
el 7 de Jul. de 2019
Editada: Andrei Bobrov
el 7 de Jul. de 2019
diff([0,z(:)'])
or
diff([0;z])
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!