Plot with a lag
5 ビュー (過去 30 日間)
古いコメントを表示
Suppose I want to have plot of lagged x and y that belong in table T. For example, I want to have a plot that the first element of T.x is paired with second element of T.y, the second element of T.x is paired with the third element of T.y, etc. Please advise.
0 件のコメント
採用された回答
その他の回答 (1 件)
Brandon Free
2018 年 6 月 8 日
編集済み: Brandon Free
2018 年 6 月 11 日
Because you have to always have the same number of x and y data, you could accomplish this by deleting a few entries. Also note that tables work the same way, meaning you always have to have the same length of x and y, so you first have to transform the tables to regular vectors.
XData = T.x;
YData = T.y;
XData(1) = [];
YData(end) = [];
plot(XData, YData)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!