ヘルプ センターヘルプ センター
timeseries オブジェクトからの平均値または最適な近似の減算
timeseries
tsout = detrend(tsin,method)
tsout = detrend(tsin,method,ind)
例
tsout = detrend(tsin,method) は、指定した method を使用して timeseries の 2 次元データから平均値または最適な近似線を減算し、さらにすべての NaN 値を削除します。
tsin
method
NaN
tsout = detrend(tsin,method,ind) は、トレンド除去する列または行のインデックスを指定します。ind は、列方向のデータ (tsin.IsTimeFirst が true) の列インデックスと行方向のデータ (tsin.IsTimeFirst が false) の行インデックスを表す整数のベクトルです。
ind
tsin.IsTimeFirst
true
false
すべて折りたたむ
2 次元データをもつ timeseries オブジェクトを作成し、各列の平均値をデータから減算します。
A = magic(3)
A = 3×3 8 1 6 3 5 7 4 9 2
tsin = timeseries(A,[1 2 3]); tsout = detrend(tsin,'constant'); tsout.Data
ans = 3×3 3 -4 1 -2 0 2 -1 4 -3
データの 2 列目と 3 列目のみを対象に、各列の平均値を減算します。
tscol = detrend(tsin,'constant',[2 3]); tscol.Data
ans = 3×3 8 -4 1 3 0 2 4 4 -3
2 次元データを含む入力 timeseries。スカラーとして指定します。
データ型: timeseries
'constant'
'linear'
トレンド除去メソッド。次のオプションのいずれかとして指定します。
'constant' — データから自動的に平均値を減算。
'linear' — データから最適な近似線を減算。
行または列インデックス。正の整数値スカラーまたはベクトルとして指定します。ind は、列方向のデータ (tsin.IsTimeFirst が true) の列インデックスと行方向のデータ (tsin.IsTimeFirst が false) の行インデックスを表します。
データ型: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
double
single
int8
int16
int32
int64
uint8
uint16
uint32
uint64
R2006a より前に導入
次の 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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office