Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Removing Duplicate Entries

Subject: Removing Duplicate Entries

From: Lin

Date: 23 Mar, 2009 15:19:01

Message: 1 of 3

Hi all.

Say i have
disp([rx' cx'])
     1 2 % to be remove
     2 6 % to be remove
     1 2
     1 3
     2 6
     3 6

How can I remove the duplicate entries?

expected result

     1 2
     1 3
     2 6
     3 6

Thank you.

Subject: Removing Duplicate Entries

From: Bruno Luong

Date: 23 Mar, 2009 15:23:01

Message: 2 of 3

"Lin " <shenqlv@yahoo.com> wrote in message <gq8995$9d8$1@fred.mathworks.com>...
> Hi all.
>
> Say i have
> disp([rx' cx'])
> 1 2 % to be remove
> 2 6 % to be remove
> 1 2
> 1 3
> 2 6
> 3 6
>
> How can I remove the duplicate entries?
>
> expected result
>
> 1 2
> 1 3
> 2 6
> 3 6
>
> Thank you.

Use UNIQUE function with 'rows' option.

Bruno

Subject: Removing Duplicate Entries

From: Lin

Date: 23 Mar, 2009 16:01:02

Message: 3 of 3

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gq89gl$psi$1@fred.mathworks.com>...
> "Lin " <shenqlv@yahoo.com> wrote in message <gq8995$9d8$1@fred.mathworks.com>...

>
> Use UNIQUE function with 'rows' option.
>
> Bruno

Thanks. I think i got the solution. Here's the code.

combine = [rx' cx'];
result = unique(combine,'rows')

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us