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

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)

回答 (1 件)

Daniel
Daniel 2016 年 7 月 20 日

0 投票

Hi Noah,
Have you tried this:
time = time - time(1);

1 件のコメント

Noah Frere
Noah Frere 2016 年 7 月 20 日
Brilliant! Thanks, wish I could have figured that out for myself...

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2016 年 7 月 18 日

コメント済み:

2016 年 7 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by