Borrar filtros
Borrar filtros

How can I plot time data so that it starts at zero seconds?

23 visualizaciones (últimos 30 días)
Noah Frere
Noah Frere el 18 de Jul. de 2016
Comentada: Noah Frere el 20 de Jul. de 2016
I have an uneven time data, and I want to get it to start at t=0 instead of 3.1. Basically, I just want to shift everything over 3.1 seconds. Here is the simple code. (My actual time data is much more complicated but if you can make this work then I can apply it to my data.) Thanks, Noah
time = [3.1 4.2 5.1 6.2];
y = [5 7 4 3];
plot(time,y)

Respuestas (1)

Daniel
Daniel el 20 de Jul. de 2016
Hi Noah,
Have you tried this:
time = time - time(1);
  1 comentario
Noah Frere
Noah Frere el 20 de Jul. de 2016
Brilliant! Thanks, wish I could have figured that out for myself...

Iniciar sesión para comentar.

Categorías

Más información sobre Time Series en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by