Detrend specified inputs/outputs

7 ビュー (過去 30 日間)
Kyle Brown
Kyle Brown 2015 年 9 月 9 日
回答済み: Kyle Brown 2015 年 9 月 9 日
Hi,
I have a data set composed of several inputs and outputs in the form.
data = idata(Y,U,Ts)
Where Y is my outputs and U are my inputs.
I would like to use the detrend function to deterrent only some of my inputs and outputs. Others I want to leave as they are. However,
data_d = detrend(data)
detrends all my data.
Thank you for any help you can offer.

採用された回答

Kyle Brown
Kyle Brown 2015 年 9 月 9 日
I worked out a way to do this. I'll post it case anyone has similar issues in the future.
For a time-domain data that is defined as:
data = iddata(Y,U,Ts);
Where Y and U are multiple inputs and outputs respectively. Specific inputs and outputs can be called using:
data_c(:,{'y1','y2','y4','y5','y6'},{'u1','u2','u3'})
We can then detrend the stated outputs only.
data_r = detrend(data_c(:,{'y1','y2','y4','y5','y6'},{'u1','u2','u3'}));
However, we must re-build the iddata.
Yf = [data_r.y(:,1) data_r.y(:,2) data.y(:,3) data_r.y(:,3) data_r.y(:,4) data_r.y(:,5)];
Uf = [data_r.u(:,1) data_r.u(:,2) data_r.u(:,3) data.u(:,4)];
data_f = iddata(Yf,Uf,Ts);
Note that the detrend data has changed the order of the inputs and outputs, with the numerical values following the order they were entered. You must adjust accordingly.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePreprocess Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by