Try this:
X = {1,'Monday';2,'Monday';3,'Monday';4,'Sunday';5,'Sunday';6,'Monday';7,'Monday'};
Y = [true;any(diff(char(X(:,2)),1,1),2);true];
idx = cumsum(Y(1:end-1));
out(:,2) = accumarray(idx,[X{:,1}],[],@(x){x([1,end])});
out(:,1) = X(Y(1:end-1),2);
and here is the output in the command window:
>> out
out =
'Monday' [2x1 double]
'Sunday' [2x1 double]
'Monday' [2x1 double]
>> out{1,2}
ans =
1
3
>> out{2,2}
ans =
4
5
>> out{3,2}
ans =
6
7
I did not put the data into a structure because while a structure with fields Monday, Tuesday, etc, makes perfect sense, placing indices in front of the names a) is not a valid variable/fieldname in MATLAB, and b) implies that the sequence order is significant, therefore an indexed container (e.g. a cell array) is more suitable.