I am not certain what you want.
This should get you started —
tv = minutes(0:15).'; % Create Data, Table & Timetable
V = sort(rand(numel(tv), 4)*100);
Event = NaN(size(tv));
Event(6:5:end) = 1:3;
T1 = table(tv,V(:,1),V(:,2),V(:,3),V(:,4),Event, 'VariableNames',{'Time(min)','V1','V2','V3','V4','Event'});
TT1 = table2timetable(T1)
EvIdx = find(~ismissing(TT1.Event)); % Event Index Vector
TTs = TT1(EvIdx(1):EvIdx(2)-1,1:end-1) % First Section
td(1) = TTs.('Time(min)')(end) - TTs.('Time(min)')(1);
Vd(1,:) = TTs{end,:} - TTs{1,:};
for k = 1:numel(EvIdx)-1
TTs = TT1(EvIdx(k):EvIdx(k+1)-1,1:end-1) % Intermediate Sections
td(k+1) = TTs.('Time(min)')(end) - TTs.('Time(min)')(1);
Vd(k+1,:) = TTs{end,:} - TTs{1,:};
end
Out = array2table([minutes(td(:)), Vd], 'VariableNames',{'TimeSpan(min)',TT1.Properties.VariableNames{1:4}})
It takes the differences between the beginning and end values of each secton and saves them to ‘td’ and ‘Vd’ then puts those results in a table.
.

