フィルターのクリア

Error when synchronizing two time series

9 ビュー (過去 30 日間)
tilfani oussama
tilfani oussama 2018 年 3 月 2 日
コメント済み: Star Strider 2018 年 3 月 2 日
I have two time series, i would like to synchronize them, in each series i have two columns (the first with date and second with data), i used thos code to synchronize (my aim is to delete data with different dates).
SP=readtable('SP dated.xlsx');
CAC40=readtable('CAC40 dated.xlsx');
t1 = SP(:,1);
tsr1=timeseries(SP,t1);
i get an error
Error using timeseries/init (line 174) The first argument must contain the data.
Error in timeseries (line 324)
this = init(this,varargin{:});
I have matlab R2015a
Bests
  2 件のコメント
John BG
John BG 2018 年 3 月 2 日
編集済み: John BG 2018 年 3 月 2 日
Hi Tilfani
would you please be so kind to attach the Excel files 'SP dated.xlsx' and 'CAC49 dated.xlsx'?
If too large files or don't want to publish contents, would it be possible for you edit just a few lines and make them available attached to your question?
prompt availability of input data helps readers supply satisfactory answers.
Star Strider
Star Strider 2018 年 3 月 2 日

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

回答 (1 件)

Jeremy Hughes
Jeremy Hughes 2018 年 3 月 2 日
Hi, I think this is a simple fix, this code may not do what you think it's doing:
t1 = SP(:,1); % is a table
I don't think timeseries accepts table inputs. What you probably want is:
t1 = SP{:,1}; % is the data in the table
If you were in a more recent version, I would also point you to timetable. https://www.mathworks.com/help/matlab/timetables.html
HTH
Jeremy

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by