timeseries2timetable
説明
TT = timeseries2timetable(
は ts
)timeseries
配列 ts
を timetable に変換します。
ts
がtimeseries
オブジェクトの場合、TT
は 1 つの変数をもつ timetable です。ts
がtimeseries
オブジェクトの配列の場合、TT
はts
内の timeseries オブジェクトと同数の変数をもつ timetable です。ts
内のすべてのtimeseries
オブジェクトのサンプル時間は同じでなければなりません。
TT = timeseries2timetable(ts1,...,tsN)
は timeseries
オブジェクト ts1,...,tsN
を timetable に変換します。TT
内の変数の数は入力の数と等しくなります。すべての timeseries
オブジェクト ts1,...,tsN
のサンプル時間は同じでなければなりません。
例
timeseries
オブジェクトの timetable への変換
10 秒間隔でサンプリングされた 5 つの乱数をもつ timeseries
オブジェクトを作成します。
ts = timeseries(rand(5,1),[0 10 20 30 40])
timeseries Common Properties: Name: 'unnamed' Time: [5x1 double] TimeInfo: tsdata.timemetadata Data: [5x1 double] DataInfo: tsdata.datametadata
ts
内の時間およびデータを表示します。
ts.Time
ans = 5×1
0
10
20
30
40
ts.Data
ans = 5×1
0.8147
0.9058
0.1270
0.9134
0.6324
ts
を timetable に変換します。
TT = timeseries2timetable(ts)
TT=5×1 timetable
Time Data
______ _______
0 sec 0.81472
10 sec 0.90579
20 sec 0.12699
30 sec 0.91338
40 sec 0.63236
timeseries
オブジェクトの配列からの timetable
timeseries
オブジェクトの配列を作成します。サンプル時間と同じベクトルを使用しますが、時系列を異なる名前にします。関数 rand
を使用して、異なるデータ値の配列を作成します。
ts1 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_1"); ts2 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_2"); ts3 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_3"); ts = [ts1 ts2 ts3]
1x3 timeseries array with properties: Events Name UserData Data DataInfo Time TimeInfo Quality QualityInfo IsTimeFirst TreatNaNasMissing Length
すべての timeseries
オブジェクトのデータを 1 つの timetable に結合します。配列内の各時系列は 1 つの変数を timetable に提供します。
TT = timeseries2timetable(ts)
TT=5×3 timetable
Time Series_1 Series_2 Series_3
______ ________ ________ ________
0 sec 0.81472 0.09754 0.15761
10 sec 0.90579 0.2785 0.97059
20 sec 0.12699 0.54688 0.95717
30 sec 0.91338 0.95751 0.48538
40 sec 0.63236 0.96489 0.80028
複数の時系列の入力
複数の入力を 1 つの timetable に変換します。
ts1 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_1"); ts2 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_2"); ts3 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_3"); TT = timeseries2timetable(ts1,ts2,ts3)
TT=5×3 timetable
Time Series_1 Series_2 Series_3
______ ________ ________ ________
0 sec 0.81472 0.09754 0.15761
10 sec 0.90579 0.2785 0.97059
20 sec 0.12699 0.54688 0.95717
30 sec 0.91338 0.95751 0.48538
40 sec 0.63236 0.96489 0.80028
入力引数
ts
— 入力時系列
timeseries
オブジェクトの配列
入力時系列。timeseries
オブジェクトの配列として指定します。
この関数は ts
のプロパティの一部を使用して、timetable でデータを代入するかプロパティを設定します。timeseries
プロパティごとに、table は出力 timetable で結果を記述します。
入力 | 出力 timetable の結果 |
---|---|
| 対応する timetable 変数の名前を示します。
|
| 対応する timetable 変数に代入されたデータを示します。 |
| 対応する timetable 変数の |
| 対応する timetable 変数の |
| サンプル時間を timetable の行時間に変換します。行時間のベクトルは、入力の |
| 行時間の単位を指定します。timetable 行時間のベクトルが |
| 行時間の形式を設定します。 |
| timetable の |
|
|
|
|
| データを再配向する必要があるかを判別します。 |
| timetable の |
| 警告。 |
| 警告。 |
|
|
バージョン履歴
R2021b で導入R2021b: timeseries2timetable
が ts2timetable
を置き換える
関数 timeseries2timetable
により、関数 ts2timetable
が置き換えられています。ただし、ts2timetable
は引き続き使用可能です。2 つの関数は同義です。R2021a では、MATLAB® では ts2timetable
のみが提供されています。
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)