Got Questions? Get Answers.
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:
no repeat for cells

Subject: no repeat for cells

From: Kurt

Date: 13 Jan, 2011 14:33:05

Message: 1 of 3

hi guys,

I have a cell array as follows :

A =

    [1x2 double]
    [1x3 double]


In these cells contain the following :

[175 ,576]
[219,219, 500]

From this cell , how can I output the following :

[175 ,576]
[219, 500]


such that no 2 numbers is repeated twice for any cell.


thank you for helping
kurtis

Subject: no repeat for cells

From: ImageAnalyst

Date: 13 Jan, 2011 15:04:30

Message: 2 of 3

kurtis:
Look up the unique() function in the help. Write back if you can't
figure it out.

Subject: no repeat for cells

From: Sean de

Date: 13 Jan, 2011 15:10:21

Message: 3 of 3

"Kurt" wrote in message <ign2f1$cv2$1@fred.mathworks.com>...
> hi guys,
>
> I have a cell array as follows :
>
> A =
>
> [1x2 double]
> [1x3 double]
>
>
> In these cells contain the following :
>
> [175 ,576]
> [219,219, 500]
>
> From this cell , how can I output the following :
>
> [175 ,576]
> [219, 500]
>
>
> such that no 2 numbers is repeated twice for any cell.
>
>
> thank you for helping
> kurtis

Hints:
doc cellfun
doc unique

celffun(@(x)unique(x),Your_Cell,'uni',false);

Tags for 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