MATLAB Answers

Synchronize time series (fints) error

2 views (last 30 days)
Caxap Puc
Caxap Puc on 1 Aug 2017
Commented: Caxap Puc on 3 Aug 2017
Hi! How can I fix an error, which appears during trying to synchronize two time series objects? I have created two time series objects: tsobj1 and tsobj2. After that using:
[ts1 ts2] = synchronize(tsobj1,tsobj2,'union')
and getting error: Undefined function 'synchronize' for input arguments of type 'fints'. Also tried [ts11 ts22] = synchronize(tsobj1,tsobj2,'intersection') - the same problem.
Can't get what I'm doing wrong.
Caxap Puc
Caxap Puc on 2 Aug 2017
Having issue with uploading mat, so find attached original CSV files. Made uploading of data manually to diminish possibility of errors, however can't force 'synchronize' to work.
Simple code to prepare data:
Last1 = round(Last(2:end),2);
Time1 = datenum(Time(2:end));
tsobj1 = fints(Time1, Last1);
Last2 = round(Last22(2:end),3);
Time2 = datenum(Time22(2:end));
tsobj2 = fints(Time2, Last2);
%tried different ways to synchronize
[ts1 ts2] = synchronize(tsobj1,tsobj2,'union');
[ts11 ts22] = synchronize(tsobj1,tsobj2,'intersection');

Sign in to comment.

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 2 Aug 2017
T1 = readtable('cem19_price-history-07-23-2017.csv', 'DatetimeType','text');
T2 = readtable('cem19_price-history-07-23-2017.csv', 'DatetimeType','text');
T1.Time = datetime(T1.Time,'I','MM/dd/yy','F','yyyy-MM-dd');
T2.Time = datetime(T2.Time,'I','MM/dd/yy','F','yyyy-MM-dd');
TT1 = table2timetable(T1);
TT2 = table2timetable(T2);
TT = synchronize(TT1,TT2);
  1 Comment
Caxap Puc
Caxap Puc on 3 Aug 2017
Thanks for solution using time tables. I'm just curious why I can't use fints synchronization solution. Interesting what is the nature of error "Undefined function 'synchronize' for input arguments of type 'fints'". It seems like fints functions are created for time series work.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!