How to get all unique positions in a cell array?
1 view (last 30 days)
Show older comments
I have a cell which contains [x, y] values for example
c = cell(1, 0);
c{1} = [1, 1];
c{2} = [1, 1];
c{3} = [2, 1];
c{4} = [2, 2];
c{5} = [2, 2];
c{5} = [2, 3];
c =
1×5 cell array
{[1 1]} {[1 1]} {[2 1]} {[2 2]} {[2 3]}
Is there a way to find all the unique values in an array. so the output would be
c =
1×4 cell array
{[1 1]} {[2 1]} {[2 2]} {[2 3]}
I have tried to use the unique function but that didn't work initally and I can't find any resources to help.
Comment if you need any more information, im still relatively new to using matlab
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Multidimensional 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!