T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1213723/Data_2.csv')
T1 =
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9
____________________ ______ ______ ______ ______ ______ ______ ______ ______
{'Time' } 1 2 3 4 5 6 7 8
{'242-23:00:57.216'} 4.0894 4.0915 4.0956 4.0935 4.0915 4.0956 4.0935 4.0925
{'242-23:03:21.016'} 4.0894 4.0915 4.0946 4.0946 4.0925 4.0967 4.0915 4.0925
{'242-23:05:45.716'} 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0946 4.0925
{'242-23:08:09.416'} 4.0894 4.0904 4.0956 4.0935 4.0915 4.0946 4.0956 4.0925
{'242-23:10:34.116'} 4.0894 4.0894 4.0946 4.0925 4.0935 4.0967 4.0946 4.0925
{'242-23:12:58.816'} 4.0894 4.0925 4.0956 4.0925 4.0915 4.0967 4.0935 4.0925
{'242-23:15:22.516'} 4.0873 4.0915 4.0946 4.0946 4.0925 4.0967 4.0915 4.0946
{'242-23:17:46.216'} 4.0883 4.0915 4.0935 4.0946 4.0915 4.0977 4.0935 4.0946
{'242-23:20:10.916'} 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0946 4.0925
{'242-23:22:35.616'} 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0935 4.0925
{'242-23:25:00.316'} 4.0873 4.0915 4.0946 4.0946 4.0925 4.0977 4.0935 4.0946
{'242-23:27:24.016'} 4.0883 4.0915 4.0935 4.0946 4.0925 4.0956 4.0935 4.0946
{'242-23:29:47.716'} 4.0894 4.0904 4.0956 4.0946 4.0925 4.0967 4.0935 4.0925
{'242-23:32:12.416'} 4.0883 4.0915 4.0956 4.0935 4.0904 4.0956 4.0935 4.0925
{'242-23:34:37.116'} 4.0894 4.0915 4.0967 4.0935 4.0925 4.0967 4.0925 4.0935
V11 = extractBefore(T1.Var1,'-');
DOY = cellfun(@str2double,V11);
DOY = datetime([zeros(size(DOY,1),2)+[0 1] DOY]);
V12 = extractAfter(T1.Var1,'-');
TOD = datetime(V12, 'InputFormat','HH:mm:ss.SSS');
DT = DOY + timeofday(TOD);
DT.Format = 'MMM-dd HH:mm:ss.SSS';
plot(DT(2:end), T1{2:end,2:end})
legend(compose('Var%d',2:size(T1,2)), 'Location','best')
T2 = addvars(T2, DT, 'Before','Var2');
T2 = removevars(T2,'Var1')
T2 =
DT Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9
___________________ ______ ______ ______ ______ ______ ______ ______ ______
NaT 1 2 3 4 5 6 7 8
Aug-29 23:00:57.216 4.0894 4.0915 4.0956 4.0935 4.0915 4.0956 4.0935 4.0925
Aug-29 23:03:21.016 4.0894 4.0915 4.0946 4.0946 4.0925 4.0967 4.0915 4.0925
Aug-29 23:05:45.716 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0946 4.0925
Aug-29 23:08:09.416 4.0894 4.0904 4.0956 4.0935 4.0915 4.0946 4.0956 4.0925
Aug-29 23:10:34.116 4.0894 4.0894 4.0946 4.0925 4.0935 4.0967 4.0946 4.0925
Aug-29 23:12:58.816 4.0894 4.0925 4.0956 4.0925 4.0915 4.0967 4.0935 4.0925
Aug-29 23:15:22.516 4.0873 4.0915 4.0946 4.0946 4.0925 4.0967 4.0915 4.0946
Aug-29 23:17:46.216 4.0883 4.0915 4.0935 4.0946 4.0915 4.0977 4.0935 4.0946
Aug-29 23:20:10.916 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0946 4.0925
Aug-29 23:22:35.616 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0935 4.0925
Aug-29 23:25:00.316 4.0873 4.0915 4.0946 4.0946 4.0925 4.0977 4.0935 4.0946
Aug-29 23:27:24.016 4.0883 4.0915 4.0935 4.0946 4.0925 4.0956 4.0935 4.0946
Aug-29 23:29:47.716 4.0894 4.0904 4.0956 4.0946 4.0925 4.0967 4.0935 4.0925
Aug-29 23:32:12.416 4.0883 4.0915 4.0956 4.0935 4.0904 4.0956 4.0935 4.0925
Aug-29 23:34:37.116 4.0894 4.0915 4.0967 4.0935 4.0925 4.0967 4.0925 4.0935
VNT2 = cell(1,size(T1,2));
VNT2(2:end) = arrayfun(@(x){num2str(x)},T1{1,2:end});
T2.Properties.VariableNames = VNT2;
T2 = T2(2:end,:)
T2 =
Time 1 2 3 4 5 6 7 8
___________________ ______ ______ ______ ______ ______ ______ ______ ______
Aug-29 23:00:57.216 4.0894 4.0915 4.0956 4.0935 4.0915 4.0956 4.0935 4.0925
Aug-29 23:03:21.016 4.0894 4.0915 4.0946 4.0946 4.0925 4.0967 4.0915 4.0925
Aug-29 23:05:45.716 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0946 4.0925
Aug-29 23:08:09.416 4.0894 4.0904 4.0956 4.0935 4.0915 4.0946 4.0956 4.0925
Aug-29 23:10:34.116 4.0894 4.0894 4.0946 4.0925 4.0935 4.0967 4.0946 4.0925
Aug-29 23:12:58.816 4.0894 4.0925 4.0956 4.0925 4.0915 4.0967 4.0935 4.0925
Aug-29 23:15:22.516 4.0873 4.0915 4.0946 4.0946 4.0925 4.0967 4.0915 4.0946
Aug-29 23:17:46.216 4.0883 4.0915 4.0935 4.0946 4.0915 4.0977 4.0935 4.0946
Aug-29 23:20:10.916 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0946 4.0925
Aug-29 23:22:35.616 4.0894 4.0904 4.0956 4.0935 4.0925 4.0967 4.0935 4.0925
Aug-29 23:25:00.316 4.0873 4.0915 4.0946 4.0946 4.0925 4.0977 4.0935 4.0946
Aug-29 23:27:24.016 4.0883 4.0915 4.0935 4.0946 4.0925 4.0956 4.0935 4.0946
Aug-29 23:29:47.716 4.0894 4.0904 4.0956 4.0946 4.0925 4.0967 4.0935 4.0925
Aug-29 23:32:12.416 4.0883 4.0915 4.0956 4.0935 4.0904 4.0956 4.0935 4.0925
Aug-29 23:34:37.116 4.0894 4.0915 4.0967 4.0935 4.0925 4.0967 4.0925 4.0935
Aug-29 23:37:00.816 4.0894 4.0925 4.0946 4.0925 4.0935 4.0967 4.0935 4.0925
TT2 = table2timetable(T2);
hsp = stackedplot(TT2(2:end,:));
VN2 = T2.Properties.VariableNames;
ylh.VerticalAlignment = 'middle';
ylh.HorizontalAlignment = 'right';