Azzera filtri
Azzera filtri

Error when synchronizing two time series

9 visualizzazioni (ultimi 30 giorni)
tilfani oussama
tilfani oussama il 2 Mar 2018
Commentato: Star Strider il 2 Mar 2018
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 Commenti
John BG
John BG il 2 Mar 2018
Modificato: John BG il 2 Mar 2018
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.

Accedi per commentare.

Risposte (1)

Jeremy Hughes
Jeremy Hughes il 2 Mar 2018
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

Categorie

Scopri di più su Time Series in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by