To merge timetables in Matlab, you can use the "outerjoin" function from the table class. This function performs a join between two tables based on matching rows in one or more specified columns.
Assuming you have two timetables called "timetable1" and "timetable2" with overlapping times, you can merge them as follows:
main.m88 chars2 lines
The 'Keys' parameter specifies the column used to match the two tables, which in this case is the 'Time' column.
The 'MergeKeys' parameter specifies that the matching rows should be merged, rather than just concatenating the two tables together.
After merging, the resulting timetable will have columns from both original timetables, with missing values (NaNs) for any non-matching rows.
Note that in order to use the "outerjoin" function with timetables, the tables package must be installed.
main.m75 chars3 lines
If the output is 1, it means the package is installed. If not, you can install it using the following command:
main.m56 chars3 lines
gistlibby LogSnag