www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/MergeTimetableAndTableExample.m

    %% Merge Timetable and Table
% Create a timetable and a table.
Measurements = [0.13 0.22 0.31 0.42 0.53 0.57 0.67 0.81 0.90 1.00]';
Device = ['A';'B';'A';'B';'A';'B';'A';'B';'A';'B'];
A = timetable(seconds(1:10)',Measurements,Device)

%%
Device = ['A';'B'];
Accuracy = [0.023;0.037];
B = table(Device,Accuracy)

%%
% Merge the timetable and table. |Device| is the key variable because both
% |A| and |B| have a variable with that name. |C| is a timetable.
C = join(A,B)