d = datetime('2021-01-01'):caldays(1):datetime('2021-01-10');
m = rand(10,5);
t = array2table(m, 'VariableNames', {'A', 'B', 'C', 'D', 'E'})
t = 10×5 table
A B C D E
________ ________ _________ ________ _______
0.98979 0.91374 0.2907 0.16664 0.85502
0.037379 0.19918 0.45673 0.96181 0.55476
0.16478 0.66507 0.72775 0.66474 0.44108
0.96658 0.74907 0.096927 0.34676 0.32186
0.33786 0.033472 0.94875 0.84561 0.43635
0.62363 0.82431 0.50066 0.99156 0.50445
0.76383 0.24839 0.37759 0.31366 0.54562
0.26933 0.50286 0.98601 0.020343 0.39307
0.53943 0.27297 0.47952 0.30908 0.33387
0.38275 0.31086 0.0038893 0.29516 0.34232
tt = table2timetable(t, 'RowTimes', d.')
tt = 10×5 timetable
Time A B C D E
___________ ________ ________ _________ ________ _______
01-Jan-2021 0.98979 0.91374 0.2907 0.16664 0.85502
02-Jan-2021 0.037379 0.19918 0.45673 0.96181 0.55476
03-Jan-2021 0.16478 0.66507 0.72775 0.66474 0.44108
04-Jan-2021 0.96658 0.74907 0.096927 0.34676 0.32186
05-Jan-2021 0.33786 0.033472 0.94875 0.84561 0.43635
06-Jan-2021 0.62363 0.82431 0.50066 0.99156 0.50445
07-Jan-2021 0.76383 0.24839 0.37759 0.31366 0.54562
08-Jan-2021 0.26933 0.50286 0.98601 0.020343 0.39307
09-Jan-2021 0.53943 0.27297 0.47952 0.30908 0.33387
10-Jan-2021 0.38275 0.31086 0.0038893 0.29516 0.34232
.... or
t = timetable('RowTimes', d.')
t =
10×0 empty timetable
t.A = m(:,1); t.B = m(:,2); t.C = m(:,3); t.D = m(:,4); t.E = m(:,5);
t
t = 10×5 timetable
Time A B C D E
___________ ________ ________ _________ ________ _______
01-Jan-2021 0.98979 0.91374 0.2907 0.16664 0.85502
02-Jan-2021 0.037379 0.19918 0.45673 0.96181 0.55476
03-Jan-2021 0.16478 0.66507 0.72775 0.66474 0.44108
04-Jan-2021 0.96658 0.74907 0.096927 0.34676 0.32186
05-Jan-2021 0.33786 0.033472 0.94875 0.84561 0.43635
06-Jan-2021 0.62363 0.82431 0.50066 0.99156 0.50445
07-Jan-2021 0.76383 0.24839 0.37759 0.31366 0.54562
08-Jan-2021 0.26933 0.50286 0.98601 0.020343 0.39307
09-Jan-2021 0.53943 0.27297 0.47952 0.30908 0.33387
10-Jan-2021 0.38275 0.31086 0.0038893 0.29516 0.34232
.... or
t = [timetable('RowTimes', d.'), array2table(m, 'VariableNames', {'A', 'B', 'C', 'D', 'E'})]
t = 10×5 timetable
Time A B C D E
___________ ________ ________ _________ ________ _______
01-Jan-2021 0.98979 0.91374 0.2907 0.16664 0.85502
02-Jan-2021 0.037379 0.19918 0.45673 0.96181 0.55476
03-Jan-2021 0.16478 0.66507 0.72775 0.66474 0.44108
04-Jan-2021 0.96658 0.74907 0.096927 0.34676 0.32186
05-Jan-2021 0.33786 0.033472 0.94875 0.84561 0.43635
06-Jan-2021 0.62363 0.82431 0.50066 0.99156 0.50445
07-Jan-2021 0.76383 0.24839 0.37759 0.31366 0.54562
08-Jan-2021 0.26933 0.50286 0.98601 0.020343 0.39307
09-Jan-2021 0.53943 0.27297 0.47952 0.30908 0.33387
10-Jan-2021 0.38275 0.31086 0.0038893 0.29516 0.34232