How to move the data to the right

8 ビュー (過去 30 日間)
Xuefei Sun
Xuefei Sun 2021 年 2 月 23 日
コメント済み: Xuefei Sun 2021 年 2 月 23 日
I have 9000 speed data(S1 to S9000) related to 9000 time data(T1 to T9000). And now I want to move the speed to the right, which means I need to increasing T. For example, I will increase h, then the time is from T1+h to T9000+h, but the speed at T1+h is still S1, and S9000 would be at T9000+h.
  4 件のコメント
Bob Thompson
Bob Thompson 2021 年 2 月 23 日
Sounds like you just need to adjust your range for your plot then.
plot(t(h:end),s(h:end));
This doesn't cover the T9001:T9000+h, range, but you won't have any data there anyway from the sounds of things.
Xuefei Sun
Xuefei Sun 2021 年 2 月 23 日
Thank you!

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

回答 (1 件)

Adam Danz
Adam Danz 2021 年 2 月 23 日
It sounds like you need to shift the data to the right by adding a constant value to the x-coordinates and then assign the orginal x-coordinates (time) to the axis tick labels by setting the XTickLabel. If this is not clear or does not solve the problem, please elaborate.
  3 件のコメント
Adam Danz
Adam Danz 2021 年 2 月 23 日
Are my suggestions clear?
Xuefei Sun
Xuefei Sun 2021 年 2 月 23 日
Yes. Thank you!

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by