Plotting the time series

1 回表示 (過去 30 日間)
Camilo  Corredor
Camilo Corredor 2015 年 8 月 22 日
回答済み: Sulaymon Eshkabilov 2019 年 5 月 5 日
I'd like to plot a time series period by period. If I have two columns data and the first column correspond to the first period and the second with the second period. I'd like to see this data like a time series. How can I do this?
I appreciate your help

回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 8 月 22 日
plot(t, YourMatrix)
When YourMatrix is a 2D array, one line is plotted for every column. The number of rows must be the same as length(t) (unless t is a scalar)
  1 件のコメント
Camilo  Corredor
Camilo Corredor 2015 年 8 月 27 日
I tried to do it, but I didn't get the results that I hope.
I hope to get it
Thanks

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


Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 5 月 5 日
If you have a two column data, then to plot them as time series. E.g. X has two columns of data and time series: The time series for each period can be generated easily. Let's say a sampling time equal to 1.
>> ts1 = 0:1:length(X(:,1))-1;
>> ts2 = ts1(end)+1:1:length(X(:,2))-1;
plot(ts1, X(:,1), ts2, X(:,2))
% use: xtickformat % with your respective dates and formats

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by