Hi there, I need to list the unique rows and its corresponding index in a matrix without the using the unique function. I have been suggested to use the unique function but it seems rather time consuming and I have to run many iterations. Any help will be appreciated. Cheers, Vishal
Data:
v1=[1 2 3 4 5; 5 3 3 2 1; 1 2 4 9 7; 1 2 3 4 5; 5 3 3 2 1][a,b,c]=unique(v1,'rows','stable')
The required output which I get from the unique function is:
a = 1 2 3 4 5 5 3 3 2 1 1 2 4 9 7b = 1 2 3c = 1 2 3 1 2
Best Answer