From: Kenneth Galea on
Hi everyone
I have the following data:
parallel = [3,1;4,1;5,1;6,2;1,3;1,4;1,5;2,6]

In this case 3,1 and 1,3 mean the same thus I need to remove 1,3....and same for all others. Is there a function to do this in Matlab??

Regards
Kenneth
From: Sean on
"Kenneth Galea" <k.galea(a)hotmail.com> wrote in message <hpcipf$cmn$1(a)fred.mathworks.com>...
> Hi everyone
> I have the following data:
> parallel = [3,1;4,1;5,1;6,2;1,3;1,4;1,5;2,6]
>
> In this case 3,1 and 1,3 mean the same thus I need to remove 1,3....and same for all others. Is there a function to do this in Matlab??

If order along the 1st dimension doesn't matter:
b = sort(parallel','ascend')';
c = unique(b,'rows');

If it does:
[trash idx] = unique(b,'rows');
c = a(sort(idx),:)
From: us on
"Kenneth Galea" <k.galea(a)hotmail.com> wrote in message <hpcipf$cmn$1(a)fred.mathworks.com>...
> Hi everyone
> I have the following data:
> parallel = [3,1;4,1;5,1;6,2;1,3;1,4;1,5;2,6]
>
> In this case 3,1 and 1,3 mean the same thus I need to remove 1,3....and same for all others. Is there a function to do this in Matlab??
>
> Regards
> Kenneth

a hint:

help unique;

us
From: Kenneth Galea on
"Sean " <sean.dewolski(a)Idontwantspam.umit.maine.edu> wrote in message <hpckds$5jm$1(a)fred.mathworks.com>...
> "Kenneth Galea" <k.galea(a)hotmail.com> wrote in message <hpcipf$cmn$1(a)fred.mathworks.com>...
> > Hi everyone
> > I have the following data:
> > parallel = [3,1;4,1;5,1;6,2;1,3;1,4;1,5;2,6]
> >
> > In this case 3,1 and 1,3 mean the same thus I need to remove 1,3....and same for all others. Is there a function to do this in Matlab??
>
> If order along the 1st dimension doesn't matter:
> b = sort(parallel','ascend')';
> c = unique(b,'rows');
>
> If it does:
> [trash idx] = unique(b,'rows');
> c = a(sort(idx),:)

Thanks for yor excellent reply.
Regards
Kenneth