Error when synchronizing two time series

조회 수: 10 (최근 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.

댓글을 달려면 로그인하십시오.

답변 (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 CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by