How do I plot one timeseries vs another from the command line?

2 ビュー (過去 30 日間)
Jason Nicholson
Jason Nicholson 2013 年 12 月 16 日
回答済み: Tamas Majoros 2018 年 8 月 15 日
I have two timeseries. I want to plot them vs each other in an XY plot. Is this possible to do this like in the tstool "XY Plots" option? I want to do this from the command line and not from tstool.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 12 月 16 日
t=-10:0.1:10;
x=sin(t);
y=cos(t)
plot(x,y)
  2 件のコメント
Jason Nicholson
Jason Nicholson 2013 年 12 月 16 日
編集済み: Azzi Abdelmalek 2013 年 12 月 16 日
You do not understand my problem and your answer is not relevant. This is not correct.
This is the data I am working with:
t=-10:0.1:10;
x=sin(t);
y=cos(t);
xx = timeseries(x,t);
yy = timeseries(y,y);
Now I want to plot xx vs yy using the timeseries object. I do not have x and y available. There must be a way to overload plot correctly to get plots of xx vs yy using the timeseries object. Right?
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 12 月 16 日
t=-10:0.1:10;
x=sin(t);
y=cos(t);
xx = timeseries(x,t);
yy = timeseries(y,t);
x1=squeeze(xx.data);
y1=squeeze(yy.data);
plot(x1,y1)

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

その他の回答 (1 件)

Tamas Majoros
Tamas Majoros 2018 年 8 月 15 日
Nice thing about timeseries is the built-in utility methods:
[xTs,yTs] = synchronize(xTs,yTs,'Union'); plot(xTs.Data,yTs.Data)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by