Union of cell matrix

2 次查看(过去 30 天)
raj singh
raj singh 2016-6-8
评论: raj singh 2016-6-9
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

采纳的回答

KSSV
KSSV 2016-6-8
unique(cell2mat(A))

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by