タイムシリーズデータのプロットについて

11 views (last 30 days)
Kengo Atomi
Kengo Atomi on 12 Jun 2020
Answered: Kenta on 12 Jun 2020
下図のようなtimeseriesデータ(時系列名はa)があるのですが、plot(a)とすると、データ1~ すべてのデータが同時にプロットされてしまいます。
データ1のみをプロットしたいのですが、何か方法はあるのでしょうか。

Accepted Answer

Kenta
Kenta on 12 Jun 2020
ts = timeseries(rand(10));
data1=ts.Data(:,1)
time=ts.Time
figure;plot(time,data1);title('time vs data1')
こんにちは、ある変数(データ)の中に、さらに変数(data1など)がある場合は、その変数名.(ドット)に続けて、ほしい変数名(data1)を打てば得られる場合が多くあります。
今回のようなtimeseries型のデータでも同様に、data1やTimeの値を上のように得ることができて、それを利用すればプロットすることができます。確認のため;をつけて値がコマンドウィンドウに表示されるようにしています。以上、役に立てば幸いです。

More Answers (0)

Categories

Find more on 時系列 in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!