Unique values in cell array
显示 更早的评论
Hi, I have a cell array and would like to find the unique values (by row) in the cell array. Each row has a variable number of numbers. However, in the documentation, unique function does not support cell array by row. Is there a way i can get past this? Thanks!
1 个评论
Geoff Hayes
2020-4-14
Charms - do you mean that you want to find the unique integers from the two columns in a single row?
采纳的回答
更多回答(1 个)
Patrik Forssén
2021-10-2
My new FEX-submission uniquearray,
solves this (and works for any type of array with any number of dimensions). Just use,
load('locations.mat', 'locations');
uniqueloc = uniquearray(locations)
1 个评论
Madmad
2024-3-25
Thanks for this script it helped me, I just had to divide my 1x200,000 cell into smaller steps to speed up the process, I think your script check the entire variable, which made it slow for my var, but in the end it worked!
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!