|
"Matt Fig" <spamanon@yahoo.com> wrote in message <i0bbg4$l1k$1@fred.mathworks.com>...
> How about a hard way?
>
> % Data
> A= [ 1 2 3 ; 4 3 5; 1 2 3; 1 2 3; 4 3 5; 5 2 1; 3 2 1; 3 5 1]
>
>
> % Engine
> B = sortrows(A);
> S = [1;any(diff(B),2)];
> [L,S] = regexp(sprintf('%i',S'),'1(0)+','start','end');
> repeated_rows = B(S,:) % Repeated Rows.
> repeat_count = (S-L+1)' % How often each repeated row appears.
Dear Matt;
Thanks a lot, this works well :) but it is really a hard way at least for me, I had to go to the help menu many times!! but how could I make change to the code if I want to list all the rows ( not only those repeated more than once)?
Best Regards
|