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!