I think this does what you want:
contentfields = fieldnames(Content);
for fieldidx = 1:numel(contentfields)
structtable = struct2cell(Content.(contentfields{fieldidx}));
structtimetable = table2timetable(structtable{1}(:, {'Date', 'Message'}));
structtimetable.Properties.VariableNames{1} = sprintf('Message_%s', contentfields{fieldidx});
structtimetable = rmmissing(structtimetable);
if fieldidx == 1
joinedtimetable = structtimetable;
else
joinedtimetable = synchronize(joinedtimetable, structtimetable, 'union');
end
end
The main issue is that some (all?) of your tables contain rows with NaT which cause problem with synchronisation. You may want to investigate that. I've removed these rows here.
9 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734961
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734961
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734970
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734970
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734974
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734974
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734981
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734981
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734984
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734984
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734988
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734988
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734991
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_734991
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_735344
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_735344
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_735370
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/476102-mutiple-time-series-synchronization#comment_735370
Sign in to comment.