Effacer les filtres
Effacer les filtres

Error when synchronizing two time series

9 vues (au cours des 30 derniers jours)
tilfani oussama
tilfani oussama le 2 Mar 2018
Commenté : Star Strider le 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 commentaires
John BG
John BG le 2 Mar 2018
Modifié(e) : John BG le 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.
Star Strider
Star Strider le 2 Mar 2018

Connectez-vous pour commenter.

Réponses (1)

Jeremy Hughes
Jeremy Hughes le 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

Catégories

En savoir plus sur Time Series dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by