>> t = table(datetime(2021,7,26,0:2:22,0,0)',datetime(2021,7,26,1:2:23,0,0)',rand(12,1),rand(12,1),'VariableNames',["Start" "Stop" "X" "Y"])
____________________ ____________________ _______ ________
26-Jul-2021 00:00:00 26-Jul-2021 01:00:00 0.55447 0.91873
26-Jul-2021 02:00:00 26-Jul-2021 03:00:00 0.98985 0.19437
26-Jul-2021 04:00:00 26-Jul-2021 05:00:00 0.97194 0.86681
26-Jul-2021 06:00:00 26-Jul-2021 07:00:00 0.30537 0.27956
26-Jul-2021 08:00:00 26-Jul-2021 09:00:00 0.36401 0.10247
26-Jul-2021 10:00:00 26-Jul-2021 11:00:00 0.31532 0.71339
26-Jul-2021 12:00:00 26-Jul-2021 13:00:00 0.67324 0.96444
26-Jul-2021 14:00:00 26-Jul-2021 15:00:00 0.37585 0.85541
26-Jul-2021 16:00:00 26-Jul-2021 17:00:00 0.45587 0.098504
26-Jul-2021 18:00:00 26-Jul-2021 19:00:00 0.13724 0.80801
26-Jul-2021 20:00:00 26-Jul-2021 21:00:00 0.72338 0.25643
26-Jul-2021 22:00:00 26-Jul-2021 23:00:00 0.9332 0.3889
>> ts = stack(t,["Start" "Stop"],'ConstantVariables',["X" "Y"])
X Y Start_Stop_Indicator Start_Stop
_______ ________ ____________________ ____________________
0.55447 0.91873 Start 26-Jul-2021 00:00:00
0.55447 0.91873 Stop 26-Jul-2021 01:00:00
0.98985 0.19437 Start 26-Jul-2021 02:00:00
0.98985 0.19437 Stop 26-Jul-2021 03:00:00
0.97194 0.86681 Start 26-Jul-2021 04:00:00
0.97194 0.86681 Stop 26-Jul-2021 05:00:00
0.30537 0.27956 Start 26-Jul-2021 06:00:00
0.30537 0.27956 Stop 26-Jul-2021 07:00:00
0.36401 0.10247 Start 26-Jul-2021 08:00:00
0.36401 0.10247 Stop 26-Jul-2021 09:00:00
0.31532 0.71339 Start 26-Jul-2021 10:00:00
0.31532 0.71339 Stop 26-Jul-2021 11:00:00
0.67324 0.96444 Start 26-Jul-2021 12:00:00
0.67324 0.96444 Stop 26-Jul-2021 13:00:00
0.37585 0.85541 Start 26-Jul-2021 14:00:00
0.37585 0.85541 Stop 26-Jul-2021 15:00:00
0.45587 0.098504 Start 26-Jul-2021 16:00:00
0.45587 0.098504 Stop 26-Jul-2021 17:00:00
0.13724 0.80801 Start 26-Jul-2021 18:00:00
0.13724 0.80801 Stop 26-Jul-2021 19:00:00
0.72338 0.25643 Start 26-Jul-2021 20:00:00
0.72338 0.25643 Stop 26-Jul-2021 21:00:00
0.9332 0.3889 Start 26-Jul-2021 22:00:00
0.9332 0.3889 Stop 26-Jul-2021 23:00:00
>> stackedplot(ts,["X" "Y"],'XVariable',"Start_Stop")