I have created something like this but looking for a better way
A = [1 1 1 40 50; 0 0 0 60 40; 2 2 2 20 10; 3 3 3 40 30; 1 1 1 60 70; 0 0 0 20 10];
B = unique(A(:,1:3),'row');
[Lia,Locb] = ismember(A(:,1:3),B,'row');
NewMat = [A , Locb];
Un_Locb = unique(Locb);
for i = 1:length(Un_Locb)
row = find(NewMat(:,6)==Un_Locb(i));
M{i} = NewMat(row,:);
end