find unique values in nested cell array

1 Ansicht (letzte 30 Tage)
PBB
PBB am 21 Jun. 2016
Kommentiert: Star Strider am 30 Jun. 2016
I have a nx1 cell array, with each row containing another cell array of variable size. I would like to isolate unique values in each nested array, while still keeping the structure of the larger cell array.
Help would be greatly appreciated. Thanks!

Akzeptierte Antwort

Star Strider
Star Strider am 21 Jun. 2016
I’m not sure what you want.
This will give you the unique values amongst all the nested cells in your cell array:
C = {{randi(99, 1, 10)}; {randi(99, 1, 5)}; {randi(99, 1, 20)}};
C1 = [C{:}];
Cu = unique([C1{:}]);
  4 Kommentare
PBB
PBB am 30 Jun. 2016
Works well, thanks!!
Star Strider
Star Strider am 30 Jun. 2016
My pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by