Union of cell matrix

2 views (last 30 days)
raj singh
raj singh on 8 Jun 2016
Commented: raj singh on 9 Jun 2016
I have a cell matrix
A={[1 2 3] [2 8] [9 2 5]};
I want unique value or union of A.
The solution should be like this = [1 2 3 5 8 9]
Please give me the

Accepted Answer

KSSV
KSSV on 8 Jun 2016
unique(cell2mat(A))

More Answers (1)

Stephen23
Stephen23 on 8 Jun 2016
>> A={[1 2 3] [2 8] [9 2 5]};
>> unique([A{:}])
ans =
1 2 3 5 8 9

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!