From: us on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hrsdhq$b4u$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <hrsba0$bj3$1(a)fred.mathworks.com>...
> >
>
> > [ax,ax,ax]=unique(a(:,2));
> > [ax,ax]=unique(ax,'first');
> > r=a(ax,:)
>
> Hm, Unless if I'm mistaken I can't see why the advantage above to this:
>
> [ax,ax]=unique(a(:,2),'first');
> r=a(ax,:)
>
> otherwise than heating twice the CPU and and being really obscure. Can we be enlighten us? I admittedly staring the three lines of code for a moment... LOL
>
> Bruno

bruno
i just LOVE to type the name AX...
even more LOLs...

us
ps: i must have a bad hair-day... really(!)...
From: Roger Stafford on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hrsdhq$b4u$1(a)fred.mathworks.com>...
> Hm, Unless if I'm mistaken I can't see why the advantage above to this:
>
> [ax,ax]=unique(a(:,2),'first');
> r=a(ax,:)
> .......

Hey, Bruno, that's equivalent to what I wrote earlier with

[t,m,n] = unique(a(:,2),'first');
b = a(m,:);

(assuming that they didn't need to be reordered back to the original order.)

Roger Stafford
From: Bruno Luong on
"Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <hrslk1$4kq$1(a)fred.mathworks.com>...
> "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hrsdhq$b4u$1(a)fred.mathworks.com>...
> > Hm, Unless if I'm mistaken I can't see why the advantage above to this:
> >
> > [ax,ax]=unique(a(:,2),'first');
> > r=a(ax,:)
> > .......
>
> Hey, Bruno, that's equivalent to what I wrote earlier with
>
> [t,m,n] = unique(a(:,2),'first');
> b = a(m,:);

Quite right Roger, this equivalence is clear with 'clear n t'. Ins't clear? LOL

Bruno