|
hi,
thanks for answering me ..here is the problem again that is ,when if there is increase in matrix's column say a(:,4), a(:,5), a(:,6).....a(:,7).then solution as given by you ,a matrix not sorting shifted and repeated versions of previously occured rows.
thanks
"Jos " <#10584@fileexchange.com> wrote in message <h72s47$13i$1@fred.mathworks.com>...
> "ratnesh " <iam_ratnesh@yahoo.co.in> wrote in message <h72qsc$m0n$1@fred.mathworks.com>...
> > Hi all.
> >
> > i have
> > a=[1 2 5
> > 2 6 7
> > 1 2 9
> > 1 3 6
> > 5 1 2 % to be remove this is shifted code of 1 2 5
> > 3 6 7
> > 7 2 6] % to be remove ,this is shifted code of 2 6 7
> >
> > How can I remove the duplicate entries.thier column may can be change?
> >
> > expected result
> > a=
> > 1 2 5
> > 2 6 7
> > 1 2 9
> > 1 3 6
> > 3 6 7
> > Thank you.
>
> In your definition of duplicates two rows are the same if the elements are the same when you SORT them. So look for UNIQUE sorted rows, as in
>
> [result_sorted,INX] = unique(sort(a,2),'rows')
> expected_result = a(INX,:)
>
> hth
> Jos
|