How to get interval value between values inside array?

I have an array created with this command
t = [0:0.01:0.99 1:0.1:9.9 10:1:100];
this creates 281 columns
I want to know difference between each columns
like time interval between 2nd and 1st colulmn and between 2nd and 3rd like wise.
How do i go about it?

 Respuesta aceptada

Use diff()
t = [0:0.01:0.99 1:0.1:9.9 10:1:100];
dt = diff(t);

2 comentarios

Thanks Ameer
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Types en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 11 de Nov. de 2020

Comentada:

el 11 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by