How do I combine data from seperate tables into one table with seperate columns

1 view (last 30 days)
I am trying to combine data from several tables into 1 table. The data is 10-minute data from turbines. So every day has 144 entries. Some turbines have days missing and therefore their length is shorter. The data looks like the following
T1
Column1 Column2 Column3
Date Time Output
01/01/2014 00:10:00 68
01/01/2014 00:20:00 68
01/01/2014 00:30:00 68
: : :
: : :
: : :
01/01/2014 23:40:00 68
01/01/2014 23:50:00 68
02/01/2014 00:00:00 68
T2
Column1 Column2 Column3
Date Time Output
01/01/2014 00:10:00 68
01/01/2014 00:20:00 68
01/01/2014 00:30:00 68
: : :
: : :
: : :
01/01/2014 23:40:00 68
01/01/2014 23:50:00 68
00/01/2014 00:00:00 68
Desired

Accepted Answer

Adam Danz
Adam Danz on 5 Feb 2020
Assuming all tables have the same number of columns with matching Variable Names, you can vertically concatenate them like this.
T = [T1; T2; T3];
  7 Comments
Adam Danz
Adam Danz on 5 Feb 2020
Edited: Adam Danz on 5 Feb 2020
What format are those columns in? Are the dates already datetime values? Is the time column durations or are they also datetime values (or something else)? If you're unsure,
class(T.Date) % where T is your table name
class(T.Time)
Here's the datetime documentation
Adam Danz
Adam Danz on 6 Feb 2020
I see that you continued the conversation here. Once that's worked out you can continue with step 2 and let us know if you get stuck.

Sign in to comment.

More Answers (1)

Steven Lord
Steven Lord on 5 Feb 2020
Consider converting these table arrays into timetable arrays. If you do you can synchronize them all to a common time basis. See this documentation page for several examples of how to synchronize timetable arrays.

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!