MATLAB: As I can compare rows in a column

columnascolumnsdivision

I have a file that has 11 columns, these columns I'm interested 3 (actually 2, the third helps me to compare rows) I apply:
fid=fopen("prueba.224");
C =textscan(fid,'%*d %*s %*d %*d %*d %d %*d %*d %*d %d %f ');
fclose(fid);
celldisp(C);
And it goes well, but I need the third column that prints compare the ranks. So divided into groups the other two columns where the row of the third column are equal.
File example:
</matlabcentral/answers/uploaded_files/34548/Captura%20de%20pantalla%202015-07-23%20a%20las%2014.57.24.png> my goal is, from the last column split the data into groups of rows where these coincide in the last column, and then these groups want to get two columns of concrete that if I can do as I put in command previous

Best Answer

f = fopen('your_data.txt');
c = textscan(f,'%s','delimiter','\n');
fclose(f);
c = c{:}
z = regexp(c,'-?\d+(\.\d+)?|\w+','match');
x = cat(1,z{:});
x(:,[1,3:end]) = cellfun(@str2double,x(:,[1,3:end]),'un',0);
t = cell2mat(x(:,4));
[~,~,c1] = unique(t);
out = accumarray(c1,(1:numel(t))',[],@(ii){x(ii,:)});
add variant
f = fopen('full_path_for_folder_with_your_file\prueba.224');
d = textscan(f,['%d %s',repmat(' %f',1,9) ],'collectoutput',1);
fclose(f);
Mc = [num2cell(d{1}),cat(1,d{2}),num2cell(d{3})];
[~,~,c] = unique(d{3}(:,2));
out = accumarray(c,(1:numel(c)).',[],@(ii){Mc(ii,:)});